Set oslo_messaging_amqp section for qpid user

Also make the setting the sasl-service-name conditional on the qpidd version and fix a function name call.

Removed bashate errors(2).

Back out the tox.ini change

Inhibit warning for long line check and remove comments

Update README for user variables

Change-Id: I17a421836bb309c4d09cf9d0904d6294f99010da
This commit is contained in:
Andrew Smith 2016-02-12 14:25:41 -05:00
parent 8829503ec9
commit b5a6ffff2b
3 changed files with 29 additions and 14 deletions

View File

@ -12,4 +12,11 @@ Devstack plugin for AMQP 1.0 olso.messaging driver
[[local|localrc]]
enable_plugin amqp1 https://git.openstack.org/openstack/devstack-plugin-amqp1
3. run ``stack.sh``
3. Set username and password variables if needed and they will be added to configuration::
AMQP1_USERNAME=queueuser
AMQP1_PASSWORD=queuepassword
4. run ``stack.sh``

View File

@ -113,7 +113,8 @@ EOF
# Add user to SASL database
local sasl_conf_file=/etc/sasl2/qpidd.conf
sudo sed -i.bak '/PLAIN/!s/mech_list: /mech_list: PLAIN /' $sasl_conf_file
local sasl_db=`sudo grep sasldb_path $sasl_conf_file | cut -f 2 -d ":" | tr -d [:blank:]`
local sasl_db
sasl_db=`sudo grep sasldb_path $sasl_conf_file | cut -f 2 -d ":" | tr -d [:blank:]`
if [ ! -e $sasl_db ]; then
sudo mkdir -p -m 755 `dirname $sasl_db`
fi
@ -139,6 +140,14 @@ log-to-file=$log_file
log-to-syslog=yes
EOF
fi
# Set the SASL service name if the version of qpidd supports it
if $QPIDD --help | grep -q "sasl-service-name"; then
cat <<EOF | sudo tee --append $qpid_conf_file
sasl-service-name=amqp
EOF
fi
sudo touch $log_file
sudo chmod a+rw $log_file # qpidd user can write to it
}
@ -191,7 +200,7 @@ function _cleanup_qpid_backend {
exit_distro_not_supported "qpid installation"
fi
_uninstall_pyngus
_remove_pyngus
}
@ -202,11 +211,10 @@ function _iniset_qpid_backend {
local section=${3:-DEFAULT}
iniset $file $section rpc_backend "amqp"
# @TODO(kgiusti) why is "qpid_" part of the setting's name? Why isn't this generic??
iniset $file $section qpid_hostname ${AMQP1_HOST}
if [ -n "$AMQP1_USERNAME" ]; then
iniset $file $section qpid_username $AMQP1_USERNAME
iniset $file $section qpid_password $AMQP1_PASSWORD
iniset $file oslo_messaging_amqp username $AMQP1_USERNAME
iniset $file oslo_messaging_amqp password $AMQP1_PASSWORD
fi
}
@ -259,7 +267,7 @@ if is_service_enabled amqp1; then
if [[ "$1" == "clean" ]]; then
# Remove state and transient data
# Remember clean.sh first calls unstack.sh
_uninstall_${AMQP1_SERVICE}_backend
_cleanup_${AMQP1_SERVICE}_backend
fi
fi

14
tox.ini
View File

@ -11,15 +11,15 @@ install_command = pip install {opts} {packages}
deps = bashate
whitelist_externals = bash
commands = bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs
-not \( -type d -name doc -prune \) \ # skip documentation
-type f \ # only files
-not -name \*~ \ # skip editors, readme, etc
-not \( -type d -name .?\* -prune \) \
-not \( -type d -name doc -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
\( \
-name \*.sh -or \
-name \*rc -or \
-name functions\* -or \
-wholename \*/lib/\* \ # /lib files are shell, but
\) \ # have no extension
-print0 | xargs -0 bashate -v"
-wholename \*/lib/\* \
\) \
-print0 | xargs -0 bashate -v -iE006"