From 78f559ec213c8ef352c0dca7c105947f6b3ec4f8 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 31 Jul 2019 00:42:52 +0200 Subject: [PATCH] [DEV] update methode to clone the repository (done it in generic) --- island/actions/islandAction_init.py | 20 +++++++------------- island/actions/islandAction_sync.py | 11 ++++++----- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/island/actions/islandAction_init.py b/island/actions/islandAction_init.py index 916a776..3bdd058 100644 --- a/island/actions/islandAction_init.py +++ b/island/actions/islandAction_init.py @@ -84,20 +84,14 @@ def execute(_arguments): conf.set_manifest_name(manifest_name) conf.store() - #clone the manifest repository - cmd = "git clone " + address_manifest + " --branch " + branch + " " + env.get_island_path_manifest() - - debug.info("clone the manifest") - ret = multiprocess.run_command_direct(cmd) - - if ret == "": - return True + debug.info("Clone the manifest") + commands.clone(env.get_island_path_manifest(), address_manifest, branch_name=branch): if ret == False: - # all is good, ready to get the system work corectly - return True - debug.info("'" + ret + "'") - debug.error("Init does not work") - return False + debug.info("'" + ret + "'") + debug.error("Init does not work") + return False + return True + diff --git a/island/actions/islandAction_sync.py b/island/actions/islandAction_sync.py index 4bdd7ad..e362202 100644 --- a/island/actions/islandAction_sync.py +++ b/island/actions/islandAction_sync.py @@ -95,15 +95,16 @@ def execute(_arguments): #clone the manifest repository address_manifest = "" ### example git@git.plouf.com:basic_folder - cmd = "git clone " + elem.select_remote["fetch"] + address_manifest = elem.select_remote["fetch"] if elem.select_remote["fetch"][0:4] == "git@" \ and len(elem.select_remote["fetch"][4:].split(":")) <= 1: - cmd += ":" + address_manifest += ":" else: - cmd += "/" - cmd += elem.name + " --branch " + elem.branch + " --origin " + elem.select_remote["name"] + " " + git_repo_path + address_manifest += "/" + address_manifest += elem.name + + " --branch " + elem.branch + " --origin " + elem.select_remote["name"] + " " + git_repo_path debug.info("clone the repo") - ret = multiprocess.run_command_direct(cmd) + ret = commands.clone(git_repo_path, address_manifest, branch_name=elem.branch, origin=elem.select_remote["name"]): if ret != "" \ and ret != False: # all is good, ready to get the system work corectly