FIX for Autodeployer 25/1625/1
authorSzilard Cserey <szilard.cserey@ericsson.com>
Mon, 14 Sep 2015 09:49:04 +0000 (11:49 +0200)
committerSzilard Cserey <szilard.cserey@ericsson.com>
Wed, 16 Sep 2015 09:33:43 +0000 (11:33 +0200)
- 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>
fuel/deploy/cloud/configure_nodes.py
fuel/deploy/common.py
fuel/deploy/deploy.py
fuel/deploy/install_fuel_master.py

index 06199d2..e76d222 100644 (file)
@@ -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)
index 3472e89..ab2bf68 100644 (file)
@@ -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,
index 304db66..1acce42 100644 (file)
@@ -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]')
index da313b0..9a2599c 100644 (file)
@@ -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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+