gate fixer: Fix devstack auth issue and new PEP8 violation
Squashes two commits needed to unblock the gate: devstack: prevent auth params set in env. polluting client calls The switch to keystone v3 has introduces issues when other devstack components set tenant or project name in environment, as it overrides those set by us in our plugin script. This ensures that doesnt happen. It also updates usage of upload_image to avoid issuing a token (no longer needed) and uses openstack client to create the nova flavor using clouds.yaml. Fix E402 pep8 violation Change-Id: Icfd0790e0f23bc9daaef6e006e39e3b94e42417e
This commit is contained in:
parent
8e57c1132c
commit
da8d8cd9fc
|
@ -22,13 +22,14 @@ Create Date: 2015-07-02 12:29:50.243891
|
|||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4f695b725637'
|
||||
down_revision = None
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table(
|
||||
|
|
|
@ -164,9 +164,9 @@ function _auth_args() {
|
|||
}
|
||||
|
||||
function create_astara_nova_flavor() {
|
||||
nova flavor-create astara $ROUTER_INSTANCE_FLAVOR_ID \
|
||||
$ROUTER_INSTANCE_FLAVOR_RAM $ROUTER_INSTANCE_FLAVOR_DISK \
|
||||
$ROUTER_INSTANCE_FLAVOR_CPUS
|
||||
openstack --os-cloud=devstack-admin flavor create astara \
|
||||
--id $ROUTER_INSTANCE_FLAVOR_ID --ram $ROUTER_INSTANCE_FLAVOR_RAM \
|
||||
--disk $ROUTER_INSTANCE_FLAVOR_DISK --vcpus $ROUTER_INSTANCE_FLAVOR_CPUS
|
||||
iniset $ASTARA_CONF router instance_flavor $ROUTER_INSTANCE_FLAVOR_ID
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,13 @@ function pre_start_astara() {
|
|||
# Create and init the database
|
||||
recreate_database astara
|
||||
astara-dbsync --config-file $ASTARA_CONF upgrade
|
||||
|
||||
local auth_args="$(_auth_args $Q_ADMIN_USERNAME $SERVICE_PASSWORD $SERVICE_TENANT_NAME)"
|
||||
|
||||
# having these set by something else in devstack will override those that we pass on
|
||||
# CLI.
|
||||
unset OS_TENANT_NAME OS_PROJECT_NAME
|
||||
|
||||
if ! neutron $auth_args net-show $PUBLIC_NETWORK_NAME; then
|
||||
neutron $auth_args net-create $PUBLIC_NETWORK_NAME --router:external
|
||||
fi
|
||||
|
@ -253,10 +259,7 @@ function pre_start_astara() {
|
|||
astara_dev_image_src=$ASTARA_DEV_APPLIANCE_URL
|
||||
fi
|
||||
|
||||
env
|
||||
TOKEN=$(openstack token issue -c id -f value)
|
||||
die_if_not_set $LINENO TOKEN "Keystone fail to get token"
|
||||
upload_image $astara_dev_image_src $TOKEN
|
||||
upload_image $astara_dev_image_src
|
||||
|
||||
local image_name=$(basename $astara_dev_image_src | cut -d. -f1)
|
||||
typeset image_id=$(glance $auth_args image-list | grep $image_name | get_field 1)
|
||||
|
|
Loading…
Reference in New Issue