gate-hook: Accomodate devstack-gate local.conf changes

With devstack-gate switching to local.conf we can no longer use bash for
evaluating settings variables. Also we shouldn't populate local.conf
directly and let devstack-gate do that.

Since now devstack never uses localrc file directly, we set [[localrc]]
sections for local.conf instead.

As a nice side effect, it will make the gate hook work with devstack
that may not have the Ie571b5fa5a33d9ed09f30ba7c7724b958ce17616 in
(Newton and below), which may make backports easier later.

Change-Id: Ibe640a584add3acc89520a2bbb25b6f4c5818e1b
Closes-bug: 1667331
This commit is contained in:
Jakub Libosvar 2017-02-23 11:31:12 -05:00 committed by Ihar Hrachyshka
parent e674034aa1
commit d46636112f
5 changed files with 15 additions and 94 deletions

View File

@ -19,6 +19,7 @@ function load_rc_hook {
config=$(cat $GATE_HOOKS/$hook)
export DEVSTACK_LOCAL_CONFIG+="
# generated from hook '$hook'
[[local|localrc]]
${config}
"
}
@ -27,7 +28,11 @@ ${config}
# Inject config from hook into local.conf
function load_conf_hook {
local hook="$1"
cat $GATE_HOOKS/$hook >> $LOCAL_CONF
config=$(cat $GATE_HOOKS/$hook)
export DEVSTACK_LOCAL_CONFIG+="
# generated from hook '$hook'
${config}
"
}
@ -68,10 +73,15 @@ case $VENV in
upgrade_ovs_if_necessary $compile_modules
# prepare base environment for ./stack.sh
load_conf_hook stack_base
load_rc_hook stack_base
# enable monitoring
load_conf_hook dstat
load_rc_hook dstat
# Since we don't use devstack-gate to deploy devstack services, we need to
# dump DEVSTACK_LOCAL_CONFIG into local.conf ourselves. Note that we should
# dump the file before changing the ownership
echo "$DEVSTACK_LOCAL_CONFIG" > $LOCAL_CONF
# Make the workspace owned by the stack user
sudo chown -R $STACK_USER:$STACK_USER $BASE

View File

@ -1,45 +1 @@
NETWORK_API_EXTENSIONS="
address-scope, \
agent, \
allowed-address-pairs, \
auto-allocated-topology, \
availability_zone, \
binding, \
default-subnetpools, \
dhcp_agent_scheduler, \
dns-integration, \
dvr, \
ext-gw-mode, \
external-net, \
extra_dhcp_opt, \
extraroute, \
flavors, \
l3-flavors, \
l3-ha, \
l3_agent_scheduler, \
metering, \
multi-provider, \
net-mtu, \
network-ip-availability, \
network_availability_zone, \
pagination, \
port-security, \
project-id, \
provider, \
qos, \
quotas, \
rbac-policies, \
router, \
router_availability_zone, \
security-group, \
service-type, \
sorting, \
standard-attr-description, \
standard-attr-revisions, \
standard-attr-timestamp, \
subnet_allocation, \
tag, \
tag-ext, \
trunk, \
trunk-details"
NETWORK_API_EXTENSIONS="$(echo $NETWORK_API_EXTENSIONS | tr -d ' ')"
NETWORK_API_EXTENSIONS="address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-integration,dvr,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,flavors,l3-flavors,l3-ha,l3_agent_scheduler,metering,multi-provider,net-mtu,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,quotas,rbac-policies,router,router_availability_zone,security-group,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-timestamp,subnet_allocation,tag,tag-ext,trunk,trunk-details"

View File

@ -1,44 +1 @@
NETWORK_API_EXTENSIONS="
address-scope, \
agent, \
allowed-address-pairs, \
auto-allocated-topology, \
availability_zone, \
binding, \
default-subnetpools, \
dhcp_agent_scheduler, \
dns-integration, \
ext-gw-mode, \
external-net, \
extra_dhcp_opt, \
extraroute, \
flavors, \
l3-flavors, \
l3-ha, \
l3_agent_scheduler, \
metering, \
multi-provider, \
net-mtu, \
network-ip-availability, \
network_availability_zone, \
pagination, \
port-security, \
project-id, \
provider, \
qos, \
quotas, \
rbac-policies, \
router, \
router_availability_zone, \
security-group, \
service-type, \
sorting, \
standard-attr-description, \
standard-attr-revisions, \
standard-attr-timestamp, \
subnet_allocation, \
tag, \
tag-ext, \
trunk, \
trunk-details"
NETWORK_API_EXTENSIONS="$(echo $NETWORK_API_EXTENSIONS | tr -d ' ')"
NETWORK_API_EXTENSIONS="address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-integration,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,flavors,l3-flavors,l3-ha,l3_agent_scheduler,metering,multi-provider,net-mtu,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,quotas,rbac-policies,router,router_availability_zone,security-group,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-timestamp,subnet_allocation,tag,tag-ext,trunk,trunk-details"

View File

@ -1,2 +1 @@
[[local|localrc]]
enable_service dstat

View File

@ -1,4 +1,3 @@
[[local|localrc]]
# set password, otherwise devstack enters interactive mode and fails
ADMIN_PASSWORD=secretadmin
# don't use screen to start services (needed to disable colorization in