owner_uuid when collection is created. Fixed indentation.
if re.match(r'[a-f0-9]{32}(\+\d+)?(\+\S+)*$', manifest_locator_or_text):
self._manifest_locator = manifest_locator_or_text
self._manifest_text = None
+ elif re.match(r'[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}$', manifest_locator_or_text):
+ self._manifest_locator = manifest_locator_or_text
+ self._manifest_text = None
elif re.match(r'(\S+)( [a-f0-9]{32}(\+\d+)(\+\S+)*)+( \d+:\d+:\S+)+\n', manifest_locator_or_text):
self._manifest_text = manifest_locator_or_text
self._manifest_locator = None
collection = arvados.api().collections().create(
body={
'manifest_text': writer.manifest_text(),
+ 'owner_uuid': project_link['tail_uuid']
},
).execute()
- # Print the locator (uuid) of the new collection.
output = collection['uuid']
if project_link is not None:
+ # Update collection name
try:
if 'name' in collection:
arvados.api().collections().update(uuid=output,
- body={"owner_uuid": project_link["tail_uuid"],
- "name": project_link["name"]}).execute()
+ body={"name": project_link["name"]}).execute()
else:
create_project_link(output, project_link)
except apiclient.errors.Error as error:
error))
status = 1
+ # Print the locator (uuid) of the new collection.
stdout.write(output)
if not output.endswith('\n'):
stdout.write('\n')
def test_put_collection_with_unnamed_project_link(self):
link = self.run_and_find_collection("Test unnamed collection",
- ['--project-uuid', self.PROJECT_UUID])
+ ['--project-uuid', self.PROJECT_UUID])
username = pwd.getpwuid(os.getuid()).pw_name
self.assertRegexpMatches(
link['name'],
def test_put_collection_with_name_and_no_project(self):
link_name = 'Test Collection Link in home project'
collection = self.run_and_find_collection("Test named collection in home project",
- ['--name', link_name])
+ ['--name', link_name])
self.assertEqual(link_name, collection['name'])
my_user_uuid = self.current_user()['uuid']
self.assertEqual(my_user_uuid, collection['owner_uuid'])
def test_put_collection_with_named_project_link(self):
link_name = 'Test auto Collection Link'
collection = self.run_and_find_collection("Test named collection",
- ['--name', link_name,
- '--project-uuid', self.PROJECT_UUID])
+ ['--name', link_name,
+ '--project-uuid', self.PROJECT_UUID])
self.assertEqual(link_name, collection['name'])