From 67bcb6b3596fe99a7ec59aa66593c218c6241355 Mon Sep 17 00:00:00 2001 From: Szilard Cserey Date: Mon, 14 Sep 2015 17:54:32 +0200 Subject: Updates for Autodeployer -Remove pre-deploy mechanism -Update reaping mechanism -Remove old DEA, DHA configuration files Change-Id: Ibc28d148bc23992e940e0247873a226d92fb7af7 Signed-off-by: Szilard Cserey --- fuel/deploy/common.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'fuel/deploy/common.py') diff --git a/fuel/deploy/common.py b/fuel/deploy/common.py index ab2bf68..2a8c0d1 100644 --- a/fuel/deploy/common.py +++ b/fuel/deploy/common.py @@ -22,7 +22,7 @@ E = {'id': 0, 'status': 1, 'name': 2, 'mode': 3, 'release_id': 4, 'changes': 5, 'pending_release_id': 6} R = {'id': 0, 'name': 1, 'state': 2, 'operating_system': 3, 'version': 4} RO = {'name': 0, 'conflicts': 1} - +CWD = os.getcwd() LOG = logging.getLogger(__name__) LOG.setLevel(logging.DEBUG) formatter = logging.Formatter('%(message)s') @@ -89,11 +89,15 @@ def warn(message): def check_file_exists(file_path): + if not os.path.dirname(file_path): + file_path = '%s/%s' % (CWD, file_path) if not os.path.isfile(file_path): err('ERROR: File %s not found\n' % file_path) def check_dir_exists(dir_path): + if not os.path.dirname(dir_path): + dir_path = '%s/%s' % (CWD, dir_path) if not os.path.isdir(dir_path): err('ERROR: Directory %s not found\n' % dir_path) @@ -107,7 +111,7 @@ def create_dir_if_not_exists(dir_path): def delete(f): if os.path.isfile(f): log('Deleting file %s' % f) - os.remove(file) + os.remove(f) elif os.path.isdir(f): log('Deleting directory %s' % f) shutil.rmtree(f) @@ -136,14 +140,6 @@ class ArgParser(argparse.ArgumentParser): sys.exit(2) -class literal_unicode(unicode): - pass - - -def literal_unicode_representer(dumper, data): - return dumper.represent_scalar(u'tag:yaml.org,2002:str', data, style='|') - - def backup(path): src = path dst = path + '_orig' -- cgit 1.2.3-korg