Merge "virtual_fuel: initial support for remote libvirt"
[fuel.git] / deploy / install_fuel_master.py
index e3a7327..5adccef 100644 (file)
@@ -21,7 +21,7 @@ from common import (
 )
 
 TRANSPLANT_FUEL_SETTINGS = 'transplant_fuel_settings.py'
-BOOTSTRAP_ADMIN = '/usr/local/sbin/bootstrap_admin_node'
+BOOTSTRAP_ADMIN = 'bootstrap_admin_node'
 FUEL_CLIENT_CONFIG = '/etc/fuel/client/config.yaml'
 PLUGINS_DIR = '~/plugins'
 LOCAL_PLUGIN_FOLDER = '/opt/opnfv'
@@ -54,8 +54,12 @@ class InstallFuelMaster(object):
 
         self.dha.node_power_off(self.fuel_node_id)
 
-        log('Zero the MBR')
-        self.dha.node_zero_mbr(self.fuel_node_id)
+        if os.environ.get('LIBVIRT_DEFAULT_URI'):
+            log('Upload ISO to pool')
+            self.iso_file = self.dha.upload_iso(self.iso_file)
+        else:
+            log('Zero the MBR')
+            self.dha.node_zero_mbr(self.fuel_node_id)
 
         self.dha.node_set_boot_order(self.fuel_node_id, ['disk', 'iso'])
 
@@ -87,7 +91,7 @@ class InstallFuelMaster(object):
         log('Found FUEL menu as PID %s, now killing it' % fuel_menu_pid)
         self.ssh_exec_cmd('kill %s' % fuel_menu_pid, False)
 
-        log('Wait until installation complete')
+        log('Wait until installation is complete')
         self.wait_until_installation_completed()
 
         log('Waiting for one minute for Fuel to stabilize')
@@ -117,6 +121,7 @@ class InstallFuelMaster(object):
         plugin_files = []
         with self.ssh as s:
             for plugin_location in [PLUGINS_DIR, LOCAL_PLUGIN_FOLDER]:
+                s.exec_cmd('mkdir -p %s' % plugin_location)
                 r = s.exec_cmd('find %s -type f -name \'*.rpm\''
                                % plugin_location)
                 plugin_files.extend(r.splitlines())
@@ -130,7 +135,7 @@ class InstallFuelMaster(object):
                                     'failed: %s' % (f, e))
 
     def wait_for_node_up(self):
-        WAIT_LOOP = 60
+        WAIT_LOOP = 240
         SLEEP_TIME = 10
         success = False
         for i in range(WAIT_LOOP):