1 ##############################################################################
2 # Copyright (c) 2017 Tim Rozet (trozet@redhat.com) and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 # Used to modify undercloud qcow2 image
14 from apex.common import constants as con
15 from apex.common import utils
16 from apex.virtual import utils as virt_utils
19 def add_upstream_packages(image):
21 Adds required base upstream packages to Undercloud for deployment
30 'python2-networking-sfc',
31 'openstack-ironic-inspector',
33 'docker-distribution',
34 'openstack-tripleo-validations',
37 'python-tripleoclient'
41 virt_ops.append({con.VIRT_INSTALL: pkg})
42 virt_utils.virt_customize(virt_ops, image)
45 def inject_calipso_installer(tmp_dir, image):
47 Downloads calipso installer script from artifacts.opnfv.org
48 and puts it under /root/ for further installation process.
51 calipso_file = os.path.basename(con.CALIPSO_INSTALLER_URL)
52 calipso_url = con.CALIPSO_INSTALLER_URL.replace(calipso_file, '')
53 utils.fetch_upstream_and_unpack(tmp_dir, calipso_url, [calipso_file])
56 {con.VIRT_UPLOAD: "{}/{}:/root/".format(tmp_dir, calipso_file)}]
57 virt_utils.virt_customize(virt_ops, image)
58 logging.info("Calipso injected into {}".format(image))
60 # TODO(trozet): add unit testing for calipso injector
61 # TODO(trozet): add rest of build for undercloud here as well