summaryrefslogtreecommitdiffstats
path: root/fuel/deploy/common.py
diff options
context:
space:
mode:
authorSzilard Cserey <szilard.cserey@ericsson.com>2015-09-14 17:54:32 +0200
committerSzilard Cserey <szilard.cserey@ericsson.com>2015-09-18 17:20:37 +0200
commite3d65c21d1e99c30af8af52ebad8e587d86f9a8d (patch)
treee831a7079b5fbd01ef801ada09f747eff3459aa6 /fuel/deploy/common.py
parent27369695b4503ae4f3b17c7b0785d2490bd83298 (diff)
Updates for Autodeployer
-Remove pre-deploy mechanism -Update reaping mechanism -Remove old DEA, DHA configuration files Change-Id: Ibc28d148bc23992e940e0247873a226d92fb7af7 Signed-off-by: Szilard Cserey <szilard.cserey@ericsson.com>
Diffstat (limited to 'fuel/deploy/common.py')
-rw-r--r--fuel/deploy/common.py16
1 files changed, 6 insertions, 10 deletions
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'