Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File paths fix #90

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ node_modules
**/node_modules
**/lib
**/package.json
cs3api4lab
2 changes: 1 addition & 1 deletion cs3api4lab/api/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_reference(file_id, endpoint=None):
if endpoint == 'default' or endpoint is None:
raise IOError('A CS3API-compatible storage endpoint must be identified by a storage UUID')
# assume we have an opaque fileid
return storage_provider.Reference(id=storage_provider.ResourceId(storage_id=endpoint, opaque_id=file_id))
return storage_provider.Reference(resource_id=storage_provider.ResourceId(storage_id=endpoint, opaque_id=file_id))

@staticmethod
def _check_and_transform_file_path(file_id):
Expand Down
15 changes: 4 additions & 11 deletions cs3api4lab/api/share_api_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,10 @@ def map_shares_to_model(self, list_response, received=False):
continue
model = self._map_share_to_dir_model(share, stat)
model['writable'] = True if ShareUtils.map_permissions_to_role(share.permissions.permissions) == 'editor' else False
except:
model = {'name': share.resource_id.opaque_id.rsplit('/', 1)[-1],
'path': share.resource_id.opaque_id,
'last_modified': '',
'created': '',
'content': None,
'format': None,
'writable': False,
'size': 13,
'type': 'file',
'mimetype': 'text/plain'}
except Exception as e:
self.log.error("Unable to map share " + share.resource_id.opaque_id + ", " + e.__str__())
continue

if received:
model['accepted'] = ShareUtils.is_accepted(list_response.shares[share_no].state)
if model['path'] not in path_list:
Expand Down
Loading