Fix: First boot from floppy, not CD-ROM
[ta/remote-installer.git] / src / remoteinstaller / installer / install.py
index eaa645b..4e0043a 100644 (file)
@@ -136,11 +136,12 @@ class Installer(object):
         host = self._uc['hosts'][hw]['hwmgmt']['address']
         user = self._uc['hosts'][hw]['hwmgmt']['user']
         passwd = self._uc['hosts'][hw]['hwmgmt']['password']
+        priv_level = self._uc['hosts'][hw]['hwmgmt'].get('priv_level', 'ADMINISTRATOR')
 
         try:
-            hw_data = hw_detect.get_hw_data(host, user, passwd, False)
+            hw_data = hw_detect.get_hw_data(host, user, passwd, priv_level, False)
         except HWException as e:
-            error = "Harware not detected for {}: {}".format(hw, str(e))
+            error = "Hardware not detected for {}: {}".format(hw, str(e))
             logging.error(error)
             raise BMCException(error)
 
@@ -153,7 +154,7 @@ class Installer(object):
         bmc_mod_name = 'remoteinstaller.installer.bmc_management.{}'.format(hw_data['product_family'].lower())
         bmc_mod = importlib.import_module(bmc_mod_name)
         bmc_class = getattr(bmc_mod, hw_data['product_family'])
-        bmc = bmc_class(host, user, passwd, bmc_log_path)
+        bmc = bmc_class(host, user, passwd, priv_level, bmc_log_path)
         bmc.set_host_name(hw)
 
         return bmc
@@ -179,7 +180,8 @@ class Installer(object):
         pre_allocated_ips = self._uc['hosts'][self._first_controller].get('pre_allocated_ips', None)
         if pre_allocated_ips:
             pre_allocated_infra_external_ip = pre_allocated_ips.get('infra_external', None)
-            self._first_controller_ip = str(IPAddress(pre_allocated_infra_external_ip))
+            if pre_allocated_infra_external_ip:
+                self._first_controller_ip = str(IPAddress(pre_allocated_infra_external_ip))
 
         if not self._first_controller_ip:
             self._first_controller_ip = str(IPAddress(first_ip)+1)
@@ -312,15 +314,16 @@ class Installer(object):
         bmc_host = bmc.get_host()
         bmc_user = bmc.get_user()
         bmc_passwd = bmc.get_passwd()
-
+        bmc_priv_level = bmc.get_priv_level()
+        
         log_file = '{}/cat_bootstrap.log'.format(self._logdir)
         try:
-            cat_file = CatFile(bmc_host, bmc_user, bmc_passwd, admin_user, admin_passwd)
+            cat_file = CatFile(bmc_host, bmc_user, bmc_passwd, bmc_priv_level, admin_user, admin_passwd)
             cat_file.cat('/srv/deployment/log/bootstrap.log', log_file)
         except CatFileException as ex:
             logging.info('Could not cat file from console: %s', str(ex))
 
-            cat_file = CatFile(bmc_host, bmc_user, bmc_passwd, 'root', 'root')
+            cat_file = CatFile(bmc_host, bmc_user, bmc_passwd, bmc_priv_level, 'root', 'root')
             cat_file.cat('/srv/deployment/log/bootstrap.log', log_file)
 
     def get_logs(self, admin_passwd):