bug fix: fix 2 bugs for image client

1. missing glance config section

2. missing import keystoneauth1.exceptions
When call glance fail during download image, it will report:
 NameError: global name 'ks_exc' is not defined

Change-Id: I17f25368f3361b4fc20a0eda9d6b2788beaa6362
This commit is contained in:
Shaohe Feng 2018-10-25 18:46:23 +00:00
parent 55ed3e2649
commit 69c6b8a3a8
2 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,7 @@
import six
from keystoneauth1 import exceptions as ks_exc
from keystoneauth1 import loading as ks_loading
from os_service_types import service_types
from oslo_concurrency import lockutils

View File

@ -202,6 +202,20 @@ function configure_cyborg_placement {
# testing.
}
function configure_cyborg_glance {
local section=${1:-glance}
local auth_section=${2:-keystone_authtoken}
iniset $CYBORG_CONF_FILE $section auth_section $auth_section
iniset $CYBORG_CONF_FILE $section auth_type "password"
iniset $CYBORG_CONF_FILE $section auth_url "$KEYSTONE_SERVICE_URI"
iniset $CYBORG_CONF_FILE $section username $section
iniset $CYBORG_CONF_FILE $section password "$SERVICE_PASSWORD"
iniset $CYBORG_CONF_FILE $section user_domain_name "$SERVICE_DOMAIN_NAME"
iniset $CYBORG_CONF_FILE $section project_name "$SERVICE_TENANT_NAME"
iniset $CYBORG_CONF_FILE $section project_domain_name "$SERVICE_DOMAIN_NAME"
iniset $CYBORG_CONF_FILE $section api_servers "$GLANCE_URL"
}
# configure_cyborg_conductor() - Is used by configure_cyborg().
# Sets conductor specific settings.
function configure_cyborg_conductor {
@ -212,6 +226,7 @@ function configure_cyborg_conductor {
# this one is needed for lookup of Cyborg API endpoint via Keystone
configure_auth_for service_catalog
configure_cyborg_placement
configure_cyborg_glance
sudo cp $CYBORG_DIR/etc/cyborg/rootwrap.conf $CYBORG_ROOTWRAP_CONF
sudo cp -r $CYBORG_DIR/etc/cyborg/rootwrap.d $CYBORG_CONF_DIR