def add_lts_image(glance_client=None, image_name=None, release=None, properties=None): """Add an Ubuntu LTS image to the current deployment. :param glance: Authenticated glanceclient :type glance: glanceclient.Client :param image_name: Label for the image in glance :type image_name: str :param release: Name of ubuntu release. :type release: str :param properties: Custom image properties :type properties: dict """ deploy_ctxt = deployment_env.get_deployment_context() image_arch = deploy_ctxt.get('TEST_IMAGE_ARCH', 'amd64') arch_image_properties = { 'arm64': { 'hw_firmware_type': 'uefi' }, 'ppc64el': { 'architecture': 'ppc64' } } properties = properties or arch_image_properties.get(image_arch) logging.info("Image architecture set to {}".format(image_arch)) image_name = image_name or LTS_IMAGE_NAME release = release or LTS_RELEASE image_url = openstack_utils.find_ubuntu_image(release=release, arch=image_arch) add_image(image_url, glance_client=glance_client, image_name=image_name, properties=properties)
def add_lts_image(glance_client=None, image_name=None, release=None): """Add an Ubuntu LTS image to the current deployment. :param glance: Authenticated glanceclient :type glance: glanceclient.Client :param image_name: Label for the image in glance :type image_name: str :param release: Name of ubuntu release. :type release: str """ image_name = image_name or LTS_IMAGE_NAME release = release or LTS_RELEASE image_url = openstack_utils.find_ubuntu_image(release=release, arch='amd64') add_image(image_url, glance_client=glance_client, image_name=image_name)
def test_find_ubuntu_image(self): self.assertEqual( openstack_utils.find_ubuntu_image('bionic', 'aarch64'), ('http://cloud-images.ubuntu.com/bionic/current/' 'bionic-server-cloudimg-aarch64.img'))