-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The File Browser's files.properties method fails because it's trying to unpack a PortalResource object in only two pieces, specifically here:
def properties(self, path):
"""
Get object properties.
:param str path: Path.
:returns: Object properties.
:rtype: cterasdk.cio.core.types.PortalResource
:raises cterasdk.exceptions.io.core.GetMetadataError: Raised on error retrieving object metadata.
"""
_, metadata = GetProperties(io.listdir, self._core, path, False).execute() <--- MORE THAN TWO ATTRIBUTES
return metadata
However this makes no sense as the doc says properties should return the whole PortalResource object. So the fix is straight forward, just return the whole object:
def properties(self, path):
"""
Get object properties.
:param str path: Path.
:returns: Object properties.
:rtype: cterasdk.cio.core.types.PortalResource
:raises cterasdk.exceptions.io.core.GetMetadataError: Raised on error retrieving object metadata.
"""
return GetProperties(io.listdir, self._core, path, False).execute()
If that's not the intended semantic of properties or my back of the fag analysis was too simplistic, I suggest accessing the attribute of interest by name, rather than unpacking the object (which possibility is already odd out of itself).
Regards,
Porca Madonna
P.S. Also you could really get rid of this print.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels