From dbc5638eac75dcc2d7cfa4c01aa5429251702273 Mon Sep 17 00:00:00 2001 From: ronny abraham Date: Wed, 12 Jul 2023 12:42:35 +0300 Subject: [PATCH] using utils.ensure_dir in the conf_setup instead of running a bash command to make the needed directories for readmes and confs. also modified layout.yml because i wanted to separate the home name for the fabric install from the directory it's meant to be installed, and i had both on, so it was duplicating the home name, ie usr/bin/fabrichome/fabrichome --- modules/conf_setup.py | 8 ++++++-- share/templates/meta/layout.yml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/conf_setup.py b/modules/conf_setup.py index a87ef18..05165aa 100644 --- a/modules/conf_setup.py +++ b/modules/conf_setup.py @@ -5,6 +5,7 @@ from fabric.api import env, task import os import sys import pathlib +import modules.utils as modules_utils dir_parent = pathlib.Path(os.path.abspath(__file__)).parents[2] sys.path.append(str(dir_parent)) @@ -229,6 +230,7 @@ def deploy_readmes(): and puts then under the top level of the project/scripts directory """ configuration = env.config + source_readmes = configuration.tools.fabric.templates.readmes dest_readmes = os.path.join( @@ -260,7 +262,8 @@ def deploy_conf(): build_dir = os.path.join(dest_path, 'build') # also create the destination 'build' directories # if they do not exist - run("mkdir -p %s" % build_dir) + modules_utils.ensure_dir(build_dir) + # run("mkdir -p %s" % build_dir) copy_directories(source_path, dest_path) @@ -274,7 +277,8 @@ def copy_directories(source_path, dest_path): dest_path -- the destination dir """ - run("mkdir -p %s" % dest_path) + # run("mkdir -p %s" % dest_path) + modules_utils.ensure_dir(dest_path) file_list = run("ls %s" % source_path).split() for fname in file_list: diff --git a/share/templates/meta/layout.yml b/share/templates/meta/layout.yml index 4bb1948..f12beba 100644 --- a/share/templates/meta/layout.yml +++ b/share/templates/meta/layout.yml @@ -13,7 +13,7 @@ paths: tools: fabric: home: "customfabric" - root: "usr/bin/customfabric" + root: "usr/bin" templates: conf: "share/templates/conf" meta: "share/templates/meta"