Skip to content

Commit

Permalink
Merge pull request #129 from whole-tale/aux_folder_cleanup
Browse files Browse the repository at this point in the history
Remove obsolete folderId and narrative handling
  • Loading branch information
Xarthisius authored Feb 15, 2021
2 parents 0b33ee7 + eb419e8 commit 0b3485f
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions gwvolman/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ def create_volume(self, instance_id):
mountpoint = volume.attrs['Mountpoint']
logging.info("Mountpoint: %s", mountpoint)

try:
self.girder_client.downloadFolderRecursive(
tale['narrativeId'], HOSTDIR + mountpoint)
except KeyError:
pass # no narrativeId
except girder_client.HttpError:
logging.warn("Narrative folder not found for tale: %s",
str(tale['_id']))
pass

os.chown(HOSTDIR + mountpoint, DEFAULT_USER, DEFAULT_GROUP)
for root, dirs, files in os.walk(HOSTDIR + mountpoint):
for obj in dirs + files:
Expand Down Expand Up @@ -105,17 +95,6 @@ def create_volume(self, instance_id):
if tale.get('dataSet') is not None:
session = self.girder_client.post(
'/dm/session', parameters={'taleId': tale['_id']})
elif tale.get('folderId'): # old format, keep it for now
data_set = [
{'itemId': folder['_id'], 'mountPath': '/' + folder['name']}
for folder in self.girder_client.listFolder(tale['folderId'])
]
data_set += [
{'itemId': item['_id'], 'mountPath': '/' + item['name']}
for item in self.girder_client.listItem(tale['folderId'])
]
session = self.girder_client.post(
'/dm/session', parameters={'dataSet': json.dumps(data_set)})
else:
session = {'_id': None}

Expand Down

0 comments on commit 0b3485f

Please # to comment.