Merge "Fix repos for fuel-mirror in separate_haproxy test" into stable/mitaka

This commit is contained in:
Jenkins 2016-10-12 18:25:02 +00:00 committed by Gerrit Code Review
commit b8c539afa0
1 changed files with 19 additions and 8 deletions

View File

@ -18,7 +18,10 @@ from proboscis import asserts
from proboscis import test
from fuelweb_test.helpers.decorators import log_snapshot_after_test
from fuelweb_test.helpers.replace_repos import parse_ubuntu_repo
from fuelweb_test.helpers import utils
from fuelweb_test.settings import EXTRA_DEB_REPOS
from fuelweb_test.settings import EXTRA_DEB_REPOS_PRIORITY
from fuelweb_test.settings import NEUTRON
from fuelweb_test.settings import NEUTRON_SEGMENT
from fuelweb_test.settings import NODEGROUPS
@ -107,14 +110,22 @@ class TestSeparateHaproxy(TestNetworkTemplatesBase):
}
)
self.show_step(5)
if MIRROR_UBUNTU != '':
ubuntu_url = MIRROR_UBUNTU.split()[1]
replace_cmd = \
"sed -i 's,http://archive.ubuntu.com/ubuntu,{0},g'" \
" /usr/share/fuel-mirror/ubuntu.yaml".format(
ubuntu_url)
self.ssh_manager.execute_on_remote(ip=admin_ip,
cmd=replace_cmd)
config_path = "/usr/share/fuel-mirror/ubuntu.yaml"
with utils.YamlEditor(config_path, ip=admin_ip) as editor:
if MIRROR_UBUNTU != '':
editor.content['ubuntu_baseurl'] = MIRROR_UBUNTU.split()[1]
if EXTRA_DEB_REPOS != '':
# replace mos-base-url to snapshot url from mos-proposed repo
for extra_deb_repo in EXTRA_DEB_REPOS.split('|'):
parsed_repo = parse_ubuntu_repo(extra_deb_repo, None,
EXTRA_DEB_REPOS_PRIORITY)
if parsed_repo['name'] == 'mos-proposed':
editor.content['mos_baseurl'] = parsed_repo['uri']
# add proposed repository
editor.content["groups"]["mos"].append(parsed_repo)
editor.content["repos"].append(parsed_repo)
create_mirror_cmd = 'fuel-mirror create -P ubuntu -G mos ubuntu'
self.ssh_manager.execute_on_remote(ip=admin_ip, cmd=create_mirror_cmd)
apply_mirror_cmd = 'fuel-mirror apply -P ubuntu -G mos ubuntu ' \