Disable online mos repos
Disable ubuntu mos-repos with potential updates for ubuntu bootstrap builder, and their recovery in case of UPDATE_MASTER Disable centos mos repos if FORCE_DISABLE_UPDATES Change-Id: I55badf5f94df07a3d492d4f4d9ce4a56407453d0
This commit is contained in:
parent
b3346832f6
commit
1205c7ad38
@ -139,6 +139,15 @@ class AdminActions(BaseActions):
|
||||
fuel_settings.pop(key)
|
||||
fuel_settings['NTP1'] = router
|
||||
|
||||
backup_path = "/var/astute.yaml"
|
||||
YamlEditor(backup_path,
|
||||
ip=self.admin_ip
|
||||
).write_content(fuel_settings)
|
||||
|
||||
fuel_settings['BOOTSTRAP']['repos'] = \
|
||||
[repo for repo in fuel_settings[
|
||||
'BOOTSTRAP']['repos'] if "mos-" not in repo['name']]
|
||||
|
||||
self.save_fuel_settings(fuel_settings)
|
||||
|
||||
@logwrap
|
||||
|
@ -179,13 +179,29 @@ class TestBasic(object):
|
||||
time.sleep(10)
|
||||
self.env.set_admin_keystone_password()
|
||||
self.env.sync_time(['admin'])
|
||||
|
||||
if settings.FORCE_DISABLE_UPDATES and settings.UPDATE_MASTER:
|
||||
raise EnvironmentError(
|
||||
"Cannot use FORCE_DISABLE_UPDATES and UPDATE_MASTER together")
|
||||
if settings.FORCE_DISABLE_UPDATES:
|
||||
cmd = "yum-config-manager --disable mos9.0-* --save"
|
||||
self.ssh_manager.check_call(
|
||||
ip=self.ssh_manager.admin_ip,
|
||||
command=cmd
|
||||
)
|
||||
|
||||
elif settings.UPDATE_MASTER:
|
||||
logger.warning("Restore online mos repos")
|
||||
backup_path = "/var/astute.yaml"
|
||||
admin_ip = self.env.get_admin_node_ip()
|
||||
backup = YamlEditor(backup_path,
|
||||
ip=admin_ip
|
||||
).get_content()
|
||||
with YamlEditor(settings.FUEL_SETTINGS_YAML,
|
||||
ip=admin_ip) as editor:
|
||||
editor.content['BOOTSTRAP']['repos'] = backup['BOOTSTRAP'][
|
||||
'repos']
|
||||
|
||||
if settings.UPDATE_FUEL_MIRROR:
|
||||
for i, url in enumerate(settings.UPDATE_FUEL_MIRROR):
|
||||
conf_file = '/etc/yum.repos.d/temporary-{}.repo'.format(i)
|
||||
@ -200,9 +216,10 @@ class TestBasic(object):
|
||||
cmd=cmd
|
||||
)
|
||||
if settings.EXTRA_DEB_REPOS:
|
||||
path = "/etc/fuel/astute.yaml"
|
||||
with YamlEditor(path,
|
||||
ip=self.env.get_admin_node_ip()) as editor:
|
||||
path = settings.FUEL_SETTINGS_YAML
|
||||
with YamlEditor(
|
||||
path,
|
||||
ip=admin_ip) as editor:
|
||||
editor.content['BOOTSTRAP']['repos'] = \
|
||||
replace_repos.replace_ubuntu_repos(
|
||||
{'value': editor.content['BOOTSTRAP']['repos']},
|
||||
|
Loading…
Reference in New Issue
Block a user