Skip loading auth plugin in case the property is set

Currently StoredContext object tries to load auth plugin even when
a specific property(eg. user_domain_id) is already set. However this
is redundant and we can use the value loaded from stack instead.

Backport note:
This change omits the change about GLOBAL_VENV parameter in devstack
because the parameter was added after 2023.1 release.

Also, this contains change Ie0876080c771fb124d4dd36f803fbfd3b108e240
because Fedora 36 image is being removed from some mirrors.

Story: 2010905
Task: 48723
Change-Id: I09805aa4e2d1b43528f70fb29c8981c01deff955
(cherry picked from commit 7197bd028b)
(cherry picked from commit afe3e4aa51)
(cherry picked from commit a2b70a9365)
(cherry picked from commit 637d3d5069)
This commit is contained in:
Takashi Kajinami 2023-09-05 10:30:57 +09:00
parent b9cb496b61
commit be70cee559
6 changed files with 16 additions and 13 deletions

View File

@ -75,7 +75,7 @@
minimal_image_ref: ${DEFAULT_IMAGE_NAME:-cirros-0.3.6-x86_64-disk} minimal_image_ref: ${DEFAULT_IMAGE_NAME:-cirros-0.3.6-x86_64-disk}
instance_type: m1.heat_int instance_type: m1.heat_int
minimal_instance_type: m1.heat_micro minimal_instance_type: m1.heat_micro
image_ref: Fedora-Cloud-Base-36-1.5.x86_64 image_ref: Fedora-Cloud-Base-37-1.7.x86_64
hidden_stack_tag: hidden hidden_stack_tag: hidden
heat_config_notify_script: /opt/stack/heat-agents/heat-config/bin/heat-config-notify heat_config_notify_script: /opt/stack/heat-agents/heat-config/bin/heat-config-notify
boot_config_env: /opt/stack/heat-templates/hot/software-config/boot-config/test_image_env.yaml boot_config_env: /opt/stack/heat-templates/hot/software-config/boot-config/test_image_env.yaml

View File

@ -478,14 +478,14 @@ function configure_tempest_for_heat {
source /etc/ci/mirror_info.sh source /etc/ci/mirror_info.sh
fi fi
HEAT_TEST_FEDORA_IMAGE_UPSTREAM=https://download.fedoraproject.org/pub/fedora/linux HEAT_TEST_FEDORA_IMAGE_UPSTREAM=https://download.fedoraproject.org/pub/fedora/linux
HEAT_TEST_FEDORA_IMAGE_PATH=releases/36/Cloud/x86_64/images/Fedora-Cloud-Base-36-1.5.x86_64.qcow2 HEAT_TEST_FEDORA_IMAGE_PATH=releases/37/Cloud/x86_64/images/Fedora-Cloud-Base-37-1.7.x86_64.qcow2
if curl --output /dev/null --silent --head --fail "${NODEPOOL_FEDORA_MIRROR}/${HEAT_TEST_FEDORA_IMAGE_PATH}"; then if curl --output /dev/null --silent --head --fail "${NODEPOOL_FEDORA_MIRROR}/${HEAT_TEST_FEDORA_IMAGE_PATH}"; then
export HEAT_TEST_FEDORA_IMAGE="${NODEPOOL_FEDORA_MIRROR}/${HEAT_TEST_FEDORA_IMAGE_PATH}" export HEAT_TEST_FEDORA_IMAGE="${NODEPOOL_FEDORA_MIRROR}/${HEAT_TEST_FEDORA_IMAGE_PATH}"
else else
export HEAT_TEST_FEDORA_IMAGE="${HEAT_TEST_FEDORA_IMAGE_UPSTREAM}/${HEAT_TEST_FEDORA_IMAGE_PATH}" export HEAT_TEST_FEDORA_IMAGE="${HEAT_TEST_FEDORA_IMAGE_UPSTREAM}/${HEAT_TEST_FEDORA_IMAGE_PATH}"
fi fi
TOKEN=$(openstack token issue -c id -f value) TOKEN=$(openstack token issue -c id -f value)
local image_exists=$( openstack image list | grep "Fedora-Cloud-Base-36-1.5.x86_64" ) local image_exists=$( openstack image list | grep "Fedora-Cloud-Base-37-1.7.x86_64" )
if [[ -z $image_exists ]]; then if [[ -z $image_exists ]]; then
if is_service_enabled g-api; then if is_service_enabled g-api; then
upload_image $HEAT_TEST_FEDORA_IMAGE $TOKEN upload_image $HEAT_TEST_FEDORA_IMAGE $TOKEN

View File

@ -51,8 +51,8 @@ a VM image that heat can launch. To do that add the following to
`[[local|localrc]]` section of `local.conf`:: `[[local|localrc]]` section of `local.conf`::
IMAGE_URL_SITE="https://download.fedoraproject.org" IMAGE_URL_SITE="https://download.fedoraproject.org"
IMAGE_URL_PATH="/pub/fedora/linux/releases/36/Cloud/x86_64/images/" IMAGE_URL_PATH="/pub/fedora/linux/releases/37/Cloud/x86_64/images/"
IMAGE_URL_FILE="Fedora-Cloud-Base-36-1.5.x86_64.qcow2" IMAGE_URL_FILE="Fedora-Cloud-Base-37-1.7.x86_64.qcow2"
IMAGE_URLS+=","$IMAGE_URL_SITE$IMAGE_URL_PATH$IMAGE_URL_FILE IMAGE_URLS+=","$IMAGE_URL_SITE$IMAGE_URL_PATH$IMAGE_URL_FILE
URLs for any cloud image may be specified, but fedora images from F20 contain URLs for any cloud image may be specified, but fedora images from F20 contain

View File

@ -298,8 +298,9 @@ class StoredContext(RequestContext):
@property @property
def roles(self): def roles(self):
if not getattr(self, '_keystone_loaded', False): if self._roles is None:
self._load_keystone_data() if not getattr(self, '_keystone_loaded', False):
self._load_keystone_data()
return self._roles return self._roles
@roles.setter @roles.setter
@ -308,8 +309,9 @@ class StoredContext(RequestContext):
@property @property
def user_domain_id(self): def user_domain_id(self):
if not getattr(self, '_keystone_loaded', False): if self._user_domain_id is None:
self._load_keystone_data() if not getattr(self, '_keystone_loaded', False):
self._load_keystone_data()
return self._user_domain_id return self._user_domain_id
@user_domain_id.setter @user_domain_id.setter
@ -318,8 +320,9 @@ class StoredContext(RequestContext):
@property @property
def project_domain_id(self): def project_domain_id(self):
if not getattr(self, '_keystone_loaded', False): if self._project_domain_id is None:
self._load_keystone_data() if not getattr(self, '_keystone_loaded', False):
self._load_keystone_data()
return self._project_domain_id return self._project_domain_id
@project_domain_id.setter @project_domain_id.setter

View File

@ -30,4 +30,4 @@ openstack flavor delete m1.heat_int
openstack flavor delete m1.heat_micro openstack flavor delete m1.heat_micro
# delete the image created # delete the image created
openstack image delete Fedora-Cloud-Base-36-1.5.x86_64 openstack image delete Fedora-Cloud-Base-37-1.7.x86_64

View File

@ -46,7 +46,7 @@ function _config_iniset {
iniset $conf_file heat_plugin instance_type m1.heat_int iniset $conf_file heat_plugin instance_type m1.heat_int
iniset $conf_file heat_plugin minimal_instance_type m1.heat_micro iniset $conf_file heat_plugin minimal_instance_type m1.heat_micro
iniset $conf_file heat_plugin image_ref Fedora-Cloud-Base-36-1.5.x86_64 iniset $conf_file heat_plugin image_ref Fedora-Cloud-Base-37-1.7.x86_64
iniset $conf_file heat_plugin minimal_image_ref $default_image_name iniset $conf_file heat_plugin minimal_image_ref $default_image_name
iniset $conf_file heat_plugin hidden_stack_tag hidden iniset $conf_file heat_plugin hidden_stack_tag hidden