From 0c447acb37a221a096249c6a9cfad4255c08f575 Mon Sep 17 00:00:00 2001 From: radhika Date: Tue, 28 Jul 2015 14:00:17 -0400 Subject: [PATCH] 6657: check git availability only when recursive copy is being used. --- doc/_includes/_arv_copy_expectations.liquid | 6 ------ sdk/python/arvados/commands/arv_copy.py | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/_includes/_arv_copy_expectations.liquid b/doc/_includes/_arv_copy_expectations.liquid index 50362def44..a76c9e7c25 100644 --- a/doc/_includes/_arv_copy_expectations.liquid +++ b/doc/_includes/_arv_copy_expectations.liquid @@ -3,10 +3,4 @@ As stated above, arv-copy is recursive by default and requires a working git rep
In addition, arv-copy requires git when copying to a git repository. Please make sure that git is installed and available. -Use the following command to check if git is available. -
~$ git --help
- -Use the following command to install git. -
~$ sudo apt-get install git
- {% include 'notebox_end' %} diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py index 5e48bc4831..e7eb5a9e28 100755 --- a/sdk/python/arvados/commands/arv_copy.py +++ b/sdk/python/arvados/commands/arv_copy.py @@ -212,6 +212,12 @@ def copy_pipeline_instance(pi_uuid, src, dst, args): pi = src.pipeline_instances().get(uuid=pi_uuid).execute(num_retries=args.retries) if args.recursive: + # Check if git is available + try: + arvados.util.run_command(['git', '--help']) + except: + abort('git command is not available. Please ensure git is installed.') + if not args.dst_git_repo: abort('--dst-git-repo is required when copying a pipeline recursively.') # Copy the pipeline template and save the copied template. @@ -589,12 +595,6 @@ def copy_collection(obj_uuid, src, dst, args): # to both repositories. # def copy_git_repo(src_git_repo, src, dst, dst_git_repo, script_version, args): - # Check if git is available - try: - arvados.util.run_command(['git', '--help']) - except: - raise Exception('git command is not available. Please ensure git is installed.') - # Identify the fetch and push URLs for the git repositories. r = src.repositories().list( filters=[['name', '=', src_git_repo]]).execute(num_retries=args.retries) -- 2.30.2