Code Review
/
fuel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
build/docker: CI: no tag reuse on env var change
[fuel.git]
/
deploy
/
install_fuel_master.py
diff --git
a/deploy/install_fuel_master.py
b/deploy/install_fuel_master.py
index
e3a7327
..
a0e28b0
100644
(file)
--- a/
deploy/install_fuel_master.py
+++ b/
deploy/install_fuel_master.py
@@
-21,7
+21,7
@@
from common import (
)
TRANSPLANT_FUEL_SETTINGS = 'transplant_fuel_settings.py'
)
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'
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)
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'])
self.dha.node_set_boot_order(self.fuel_node_id, ['disk', 'iso'])
@@
-80,14
+84,14
@@
class InstallFuelMaster(object):
log('Wait until Fuel menu is up')
fuel_menu_pid = self.wait_until_fuel_menu_up()
log('Wait until Fuel menu is up')
fuel_menu_pid = self.wait_until_fuel_menu_up()
- log('Inject our own astute.yaml settings')
- self.inject_own_astute_yaml()
+ log('Inject our own astute.yaml
and fuel_bootstrap_cli.yaml
settings')
+ self.inject_own_astute_
and_bootstrap_
yaml()
log('Let the Fuel deployment continue')
log('Found FUEL menu as PID %s, now killing it' % fuel_menu_pid)
self.ssh_exec_cmd('kill %s' % fuel_menu_pid, False)
log('Let the Fuel deployment continue')
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')
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]:
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())
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):
'failed: %s' % (f, e))
def wait_for_node_up(self):
- WAIT_LOOP =
6
0
+ WAIT_LOOP =
24
0
SLEEP_TIME = 10
success = False
for i in range(WAIT_LOOP):
SLEEP_TIME = 10
success = False
for i in range(WAIT_LOOP):
@@
-151,13
+156,12
@@
class InstallFuelMaster(object):
def wait_until_fuel_menu_up(self):
WAIT_LOOP = 60
SLEEP_TIME = 10
def wait_until_fuel_menu_up(self):
WAIT_LOOP = 60
SLEEP_TIME = 10
- CMD = 'ps -ef'
- SEARCH = 'fuelmenu'
+ CMD = 'pgrep -f fuelmenu'
fuel_menu_pid = None
with self.ssh:
for i in range(WAIT_LOOP):
ret = self.ssh.exec_cmd(CMD)
fuel_menu_pid = None
with self.ssh:
for i in range(WAIT_LOOP):
ret = self.ssh.exec_cmd(CMD)
- fuel_menu_pid =
self.get_fuel_menu_pid(ret, SEARCH
)
+ fuel_menu_pid =
ret.strip(
)
if not fuel_menu_pid:
time.sleep(SLEEP_TIME)
else:
if not fuel_menu_pid:
time.sleep(SLEEP_TIME)
else:
@@
-166,17
+170,12
@@
class InstallFuelMaster(object):
raise Exception('Could not find the Fuel Menu Process ID')
return fuel_menu_pid
raise Exception('Could not find the Fuel Menu Process ID')
return fuel_menu_pid
- def get_fuel_menu_pid(self, printout, search):
- for line in printout.splitlines():
- if line.endswith(search):
- return clean(line)[1]
-
def ssh_exec_cmd(self, cmd, check=True):
with self.ssh:
ret = self.ssh.exec_cmd(cmd, check=check)
return ret
def ssh_exec_cmd(self, cmd, check=True):
with self.ssh:
ret = self.ssh.exec_cmd(cmd, check=check)
return ret
- def inject_own_astute_yaml(self):
+ def inject_own_astute_
and_bootstrap_
yaml(self):
with self.ssh as s:
s.exec_cmd('rm -rf %s' % self.work_dir, False)
s.exec_cmd('mkdir %s' % self.work_dir)
with self.ssh as s:
s.exec_cmd('rm -rf %s' % self.work_dir, False)
s.exec_cmd('mkdir %s' % self.work_dir)
@@
-193,7
+192,7
@@
class InstallFuelMaster(object):
def wait_until_installation_completed(self):
WAIT_LOOP = 360
SLEEP_TIME = 10
def wait_until_installation_completed(self):
WAIT_LOOP = 360
SLEEP_TIME = 10
- CMD = 'p
s -ef | grep %s | grep -v grep
' % BOOTSTRAP_ADMIN
+ CMD = 'p
grep -f %s
' % BOOTSTRAP_ADMIN
install_completed = False
with self.ssh:
install_completed = False
with self.ssh: