[ARVADOS] updated: 04a4fa5843c3511260a750065cf79203ae1663ee
git at public.curoverse.com
git at public.curoverse.com
Tue Sep 16 11:33:16 EDT 2014
Summary of changes:
sdk/python/arvados/commands/copy.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
via 04a4fa5843c3511260a750065cf79203ae1663ee (commit)
from 963c9e8f87f09ff798e23e0c9ddca6eb7bbec796 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 04a4fa5843c3511260a750065cf79203ae1663ee
Author: Tim Pierce <twp at curoverse.com>
Date: Tue Sep 16 11:31:17 2014 -0400
3699: code review
* Issue helpful error message when config file cannot be opened
* Require --dst_git_repo argument
* Allow collections without owner_uuid (i.e. when retrieved by data hash
rather than uuid)
* Corrected "source"/"destination" error message in copy_git_repo
diff --git a/sdk/python/arvados/commands/copy.py b/sdk/python/arvados/commands/copy.py
index 207a507..67fce1c 100755
--- a/sdk/python/arvados/commands/copy.py
+++ b/sdk/python/arvados/commands/copy.py
@@ -45,6 +45,7 @@ def main():
help='Do not copy any dependencies. NOTE: if this option is given, the copied object will need to be updated manually in order to be functional.')
parser.add_argument(
'--dst-git-repo', dest='dst_git_repo',
+ required=True,
help='The name of the destination git repository.')
parser.add_argument(
'--project_uuid', dest='project_uuid',
@@ -104,7 +105,14 @@ def api_for_instance(instance_name):
if '/' in instance_name:
abort('illegal instance name {}'.format(instance_name))
config_file = os.path.join(os.environ['HOME'], '.config', 'arvados', "{}.conf".format(instance_name))
- cfg = arvados.config.load(config_file)
+ try:
+ cfg = arvados.config.load(config_file)
+ except (IOError, OSError) as e:
+ abort(("Could not open config file {}: {}\n" +
+ "You must make sure that your configuration tokens\n" +
+ "for Arvados instance {} are in {} and that this\n" +
+ "file is readable.").format(
+ config_file, e, instance_name, config_file))
if 'ARVADOS_API_HOST' in cfg and 'ARVADOS_API_TOKEN' in cfg:
api_is_insecure = (
@@ -310,8 +318,10 @@ def copy_collection(obj_uuid, src, dst):
logger.debug('saving {} manifest: {}'.format(obj_uuid, manifest))
dst_keep.put(manifest)
- del c['uuid']
- del c['owner_uuid']
+ if 'uuid' in c:
+ del c['uuid']
+ if 'owner_uuid' in c:
+ del c['owner_uuid']
c['ensure_unique_name'] = True
return dst.collections().create(body=c).execute()
@@ -344,7 +354,7 @@ def copy_git_repo(src_git_repo, src, dst, dst_git_repo):
r = dst.repositories().list(
filters=[['name', '=', dst_git_repo]]).execute()
if r['items_available'] != 1:
- raise Exception('cannot identify source repo {}; {} repos found'
+ raise Exception('cannot identify destination repo {}; {} repos found'
.format(dst_git_repo, r['items_available']))
dst_git_push_url = r['items'][0]['push_url']
logger.debug('dst_git_push_url: {}'.format(dst_git_push_url))
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list