diff options
author | Szilard Cserey <szilard.cserey@ericsson.com> | 2015-09-14 11:49:04 +0200 |
---|---|---|
committer | Szilard Cserey <szilard.cserey@ericsson.com> | 2015-09-14 16:35:45 +0200 |
commit | d72aa3b7da9f9e2eb5bd0690be58365027a70f0a (patch) | |
tree | b72970a7a2c0ec40d2f1deabff4f05975df60c59 | |
parent | 282a53a0d531fb39bd39d5c6673c72f240feb9d7 (diff) |
FIX for Autodeployer
- Fuel installation - fix for finding fuelmenu
- ugo+rwx access rights to autodeploy.log file
- backward compatibility for argument parsing of ISO, DEA, DHA
Change-Id: Ib4ad5b0868a25b0357cfcd9d8f644bb3a0703b25
Signed-off-by: Szilard Cserey <szilard.cserey@ericsson.com>
-rw-r--r-- | fuel/deploy/cloud/configure_nodes.py | 2 | ||||
-rw-r--r-- | fuel/deploy/common.py | 3 | ||||
-rw-r--r-- | fuel/deploy/deploy.py | 29 | ||||
-rw-r--r-- | fuel/deploy/install_fuel_master.py | 27 |
4 files changed, 45 insertions, 16 deletions
diff --git a/fuel/deploy/cloud/configure_nodes.py b/fuel/deploy/cloud/configure_nodes.py index 06199d2..e76d222 100644 --- a/fuel/deploy/cloud/configure_nodes.py +++ b/fuel/deploy/cloud/configure_nodes.py @@ -88,7 +88,7 @@ class ConfigureNodes(object): interface_yaml = ('%s/node_%s/interfaces.yaml' % (self.yaml_config_dir, node_id)) check_file_exists(interface_yaml) - backup(interface_yaml) + backup('%s/node_%s' % (self.yaml_config_dir, node_id)) with io.open(interface_yaml) as stream: interfaces = yaml.load(stream) diff --git a/fuel/deploy/common.py b/fuel/deploy/common.py index 3472e89..ab2bf68 100644 --- a/fuel/deploy/common.py +++ b/fuel/deploy/common.py @@ -13,6 +13,7 @@ import os import logging import argparse import shutil +import stat import errno N = {'id': 0, 'status': 1, 'name': 2, 'cluster': 3, 'ip': 4, 'mac': 5, @@ -31,7 +32,7 @@ LOG.addHandler(out_handler) out_handler = logging.FileHandler('autodeploy.log', mode='w') out_handler.setFormatter(formatter) LOG.addHandler(out_handler) - +os.chmod('autodeploy.log', stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) def exec_cmd(cmd, check=True): process = subprocess.Popen(cmd, diff --git a/fuel/deploy/deploy.py b/fuel/deploy/deploy.py index 304db66..1acce42 100644 --- a/fuel/deploy/deploy.py +++ b/fuel/deploy/deploy.py @@ -242,15 +242,26 @@ def parse_arguments(): parser.add_argument('-c', dest='cleanup', action='store_true', default=False, help='Cleanup after deploy') - parser.add_argument('-iso', dest='iso_file', action='store', nargs='?', - default='%s/OPNFV.iso' % CWD, - help='ISO File [default: OPNFV.iso]') - parser.add_argument('-dea', dest='dea_file', action='store', nargs='?', - default='%s/dea.yaml' % CWD, - help='Deployment Environment Adapter: dea.yaml') - parser.add_argument('-dha', dest='dha_file', action='store', nargs='?', - default='%s/dha.yaml' % CWD, - help='Deployment Hardware Adapter: dha.yaml') + if {'-iso', '-dea', '-dha', '-h'}.intersection(sys.argv): + parser.add_argument('-iso', dest='iso_file', action='store', nargs='?', + default='%s/OPNFV.iso' % CWD, + help='ISO File [default: OPNFV.iso]') + parser.add_argument('-dea', dest='dea_file', action='store', nargs='?', + default='%s/dea.yaml' % CWD, + help='Deployment Environment Adapter: dea.yaml') + parser.add_argument('-dha', dest='dha_file', action='store', nargs='?', + default='%s/dha.yaml' % CWD, + help='Deployment Hardware Adapter: dha.yaml') + else: + parser.add_argument('iso_file', action='store', nargs='?', + default='%s/OPNFV.iso' % CWD, + help='ISO File [default: OPNFV.iso]') + parser.add_argument('dea_file', action='store', nargs='?', + default='%s/dea.yaml' % CWD, + help='Deployment Environment Adapter: dea.yaml') + parser.add_argument('dha_file', action='store', nargs='?', + default='%s/dha.yaml' % CWD, + help='Deployment Hardware Adapter: dha.yaml') parser.add_argument('-s', dest='storage_dir', action='store', default='%s/images' % CWD, help='Storage Directory [default: images]') diff --git a/fuel/deploy/install_fuel_master.py b/fuel/deploy/install_fuel_master.py index da313b0..9a2599c 100644 --- a/fuel/deploy/install_fuel_master.py +++ b/fuel/deploy/install_fuel_master.py @@ -125,12 +125,9 @@ class InstallFuelMaster(object): return fuel_menu_pid def get_fuel_menu_pid(self, printout, search): - fuel_menu_pid = None for line in printout.splitlines(): - if search in line: - fuel_menu_pid = clean(line)[1] - break - return fuel_menu_pid + if line.endswith(search): + return clean(line)[1] def ssh_exec_cmd(self, cmd, check=True): with self.ssh: @@ -186,3 +183,23 @@ class InstallFuelMaster(object): log('Delete deprecated fuel client config %s' % FUEL_CLIENT_CONFIG) with self.ssh as s: s.exec_cmd('rm %s' % FUEL_CLIENT_CONFIG, False) + + + + + + + + + + + + + + + + + + + + |