Merge "Use fuel-devops's method in reinstallation of master node" into stable/mitaka
This commit is contained in:
commit
7b91d7bb2d
@ -13,7 +13,6 @@
|
||||
# under the License.
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from devops.error import TimeoutError
|
||||
@ -371,19 +370,6 @@ class EnvironmentModel(object):
|
||||
.format(settings.KEYSTONE_CREDS['username'],
|
||||
settings.KEYSTONE_CREDS['password']))
|
||||
|
||||
def insert_cdrom_tray(self):
|
||||
# This is very rude implementation and it SHOULD be changes after
|
||||
# implementation this feature in fuel-devops
|
||||
name = "{}_{}".format(settings.ENV_NAME, self.d_env.nodes().admin.name)
|
||||
name_size = 80
|
||||
if len(name) > name_size:
|
||||
hash_str = str(hash(name))
|
||||
name = (hash_str + name)[:name_size]
|
||||
|
||||
cmd = """EDITOR="sed -i s/tray=\\'open\\'//" virsh edit {}""".format(
|
||||
name)
|
||||
subprocess.check_call(cmd, shell=True)
|
||||
|
||||
def setup_environment(self, custom=settings.CUSTOM_ENV,
|
||||
build_images=settings.BUILD_IMAGES,
|
||||
iso_connect_as=settings.ADMIN_BOOT_DEVICE,
|
||||
|
@ -262,11 +262,16 @@ class TestBasic(object):
|
||||
|
||||
def reinstall_master_node(self):
|
||||
"""Erase boot sector and run setup_environment"""
|
||||
admin = self.env.d_env.get_node(name="admin")
|
||||
with self.env.d_env.get_admin_remote() as remote:
|
||||
erase_data_from_hdd(remote, mount_point='/boot')
|
||||
remote.execute("/sbin/shutdown")
|
||||
self.env.d_env.nodes().admin.destroy()
|
||||
self.env.insert_cdrom_tray()
|
||||
admin.destroy()
|
||||
admin.close_tray()
|
||||
if settings.ADMIN_BOOT_DEVICE == 'usb':
|
||||
volume = admin.disk_devices.get(device='disk', bus='usb').volume
|
||||
else: # cdrom is default
|
||||
volume = admin.disk_devices.get(device='cdrom').volume
|
||||
volume.upload(settings.ISO_PATH)
|
||||
self.env.setup_environment()
|
||||
self.fuel_post_install_actions()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user