Merge "Change bootstrap Ubuntu mirror updater according to the new format"
This commit is contained in:
commit
920ecaf9b9
@ -270,9 +270,11 @@ class AdminActions(BaseActions):
|
|||||||
fuel_settings['NTP1'] = router
|
fuel_settings['NTP1'] = router
|
||||||
|
|
||||||
if MIRROR_UBUNTU:
|
if MIRROR_UBUNTU:
|
||||||
fuel_settings['BOOTSTRAP']['MIRROR_DISTRO'] = \
|
fuel_settings['BOOTSTRAP']['ubuntu_repos'] = \
|
||||||
replace_repos.replace_ubuntu_repo_url(
|
replace_repos.replace_ubuntu_repos(
|
||||||
fuel_settings['BOOTSTRAP']['MIRROR_DISTRO'],
|
{
|
||||||
|
'value': fuel_settings['BOOTSTRAP']['ubuntu_repos']
|
||||||
|
},
|
||||||
upstream_host='archive.ubuntu.com')
|
upstream_host='archive.ubuntu.com')
|
||||||
logger.info("Replace default Ubuntu mirror URL for "
|
logger.info("Replace default Ubuntu mirror URL for "
|
||||||
"bootstrap image in Fuel settings")
|
"bootstrap image in Fuel settings")
|
||||||
|
@ -18,26 +18,6 @@ from fuelweb_test import logger
|
|||||||
import fuelweb_test.settings as help_data
|
import fuelweb_test.settings as help_data
|
||||||
|
|
||||||
|
|
||||||
def replace_ubuntu_repo_url(repo_url, upstream_host):
|
|
||||||
repos_attr = {
|
|
||||||
"value": [
|
|
||||||
{
|
|
||||||
"name": "ubuntu-bootstrap",
|
|
||||||
"uri": repo_url,
|
|
||||||
"type": "deb",
|
|
||||||
"section": None,
|
|
||||||
"suite": None
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
repos = replace_ubuntu_repos(repos_attr, upstream_host)
|
|
||||||
new_repo_url = repos[0]['uri']
|
|
||||||
if new_repo_url != repo_url:
|
|
||||||
logger.debug("Ubuntu repository url changed from '{0}' to '{1}'"
|
|
||||||
.format(repo_url, new_repo_url))
|
|
||||||
return new_repo_url
|
|
||||||
|
|
||||||
|
|
||||||
def replace_ubuntu_repos(repos_attr, upstream_host):
|
def replace_ubuntu_repos(repos_attr, upstream_host):
|
||||||
# Walk thru repos_attr and replace/add extra Ubuntu mirrors
|
# Walk thru repos_attr and replace/add extra Ubuntu mirrors
|
||||||
if help_data.MIRROR_UBUNTU:
|
if help_data.MIRROR_UBUNTU:
|
||||||
|
Loading…
Reference in New Issue
Block a user