summaryrefslogtreecommitdiffstats
path: root/apex/undercloud/undercloud.py
diff options
context:
space:
mode:
Diffstat (limited to 'apex/undercloud/undercloud.py')
-rw-r--r--apex/undercloud/undercloud.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/apex/undercloud/undercloud.py b/apex/undercloud/undercloud.py
index d28ed981..915c85f3 100644
--- a/apex/undercloud/undercloud.py
+++ b/apex/undercloud/undercloud.py
@@ -31,8 +31,10 @@ class Undercloud:
"""
def __init__(self, image_path, template_path,
root_pw=None, external_network=False,
- image_name='undercloud.qcow2'):
+ image_name='undercloud.qcow2',
+ os_version=constants.DEFAULT_OS_VERSION):
self.ip = None
+ self.os_version = os_version
self.root_pw = root_pw
self.external_net = external_network
self.volume = os.path.join(constants.LIBVIRT_VOLUME_PATH,
@@ -73,6 +75,7 @@ class Undercloud:
template_dir=self.template_path)
self.setup_volumes()
self.inject_auth()
+ self._update_delorean_repo()
def _set_ip(self):
ip_out = self.vm.interfaceAddresses(
@@ -202,8 +205,9 @@ class Undercloud:
"undercloud_update_packages false",
"undercloud_debug false",
"inspection_extras false",
- "ipxe {}".format(str(ds['global_params'].get('ipxe', True) and
- not config['aarch64'])),
+ "ipxe_enabled {}".format(
+ str(ds['global_params'].get('ipxe', True) and
+ not config['aarch64'])),
"undercloud_hostname undercloud.{}".format(ns['dns-domain']),
"local_ip {}/{}".format(str(ns_admin['installer_vm']['ip']),
str(ns_admin['cidr']).split('/')[1]),
@@ -236,4 +240,22 @@ class Undercloud:
"enabled": ns_external['enabled']
}
+ config['http_proxy'] = ns.get('http_proxy', '')
+ config['https_proxy'] = ns.get('https_proxy', '')
+
return config
+
+ def _update_delorean_repo(self):
+ if utils.internet_connectivity():
+ logging.info('Updating delorean repo on Undercloud')
+ delorean_repo = (
+ "https://trunk.rdoproject.org/centos7-{}"
+ "/current-tripleo/delorean.repo".format(self.os_version))
+ cmd = ("curl -L -f -o "
+ "/etc/yum.repos.d/deloran.repo {}".format(delorean_repo))
+ try:
+ virt_utils.virt_customize({constants.VIRT_RUN_CMD: cmd},
+ self.volume)
+ except Exception:
+ logging.warning("Failed to download and update delorean repo "
+ "for Undercloud")