Browse Source

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
Andrew Smith 3 years ago
parent
commit
b5a6ffff2b
3 changed files with 29 additions and 14 deletions
  1. 8
    1
      README.rst
  2. 14
    6
      devstack/plugin.sh
  3. 7
    7
      tox.ini

+ 8
- 1
README.rst View File

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

+ 14
- 6
devstack/plugin.sh View File

@@ -113,7 +113,8 @@ EOF
113 113
         # Add user to SASL database
114 114
         local sasl_conf_file=/etc/sasl2/qpidd.conf
115 115
         sudo sed -i.bak '/PLAIN/!s/mech_list: /mech_list: PLAIN /' $sasl_conf_file
116
-        local sasl_db=`sudo grep sasldb_path $sasl_conf_file | cut -f 2 -d ":" | tr -d [:blank:]`
116
+        local sasl_db
117
+        sasl_db=`sudo grep sasldb_path $sasl_conf_file | cut -f 2 -d ":" | tr -d [:blank:]`
117 118
         if [ ! -e $sasl_db ]; then
118 119
             sudo mkdir -p -m 755 `dirname $sasl_db`
119 120
         fi
@@ -139,6 +140,14 @@ log-to-file=$log_file
139 140
 log-to-syslog=yes
140 141
 EOF
141 142
     fi
143
+
144
+    # Set the SASL service name if the version of qpidd supports it
145
+    if $QPIDD --help | grep -q "sasl-service-name"; then
146
+        cat <<EOF | sudo tee --append $qpid_conf_file
147
+sasl-service-name=amqp
148
+EOF
149
+    fi
150
+
142 151
     sudo touch $log_file
143 152
     sudo chmod a+rw $log_file  # qpidd user can write to it
144 153
 }
@@ -191,7 +200,7 @@ function _cleanup_qpid_backend {
191 200
         exit_distro_not_supported "qpid installation"
192 201
     fi
193 202
 
194
-    _uninstall_pyngus
203
+    _remove_pyngus
195 204
 }
196 205
 
197 206
 
@@ -202,11 +211,10 @@ function _iniset_qpid_backend {
202 211
     local section=${3:-DEFAULT}
203 212
 
204 213
     iniset $file $section rpc_backend "amqp"
205
-    # @TODO(kgiusti) why is "qpid_" part of the setting's name?  Why isn't this generic??
206 214
     iniset $file $section qpid_hostname ${AMQP1_HOST}
207 215
     if [ -n "$AMQP1_USERNAME" ]; then
208
-        iniset $file $section qpid_username $AMQP1_USERNAME
209
-        iniset $file $section qpid_password $AMQP1_PASSWORD
216
+        iniset $file oslo_messaging_amqp username $AMQP1_USERNAME
217
+        iniset $file oslo_messaging_amqp password $AMQP1_PASSWORD
210 218
     fi
211 219
 }
212 220
 
@@ -259,7 +267,7 @@ if is_service_enabled amqp1; then
259 267
     if [[ "$1" == "clean" ]]; then
260 268
         # Remove state and transient data
261 269
         # Remember clean.sh first calls unstack.sh
262
-        _uninstall_${AMQP1_SERVICE}_backend
270
+        _cleanup_${AMQP1_SERVICE}_backend
263 271
     fi
264 272
 fi
265 273
 

+ 7
- 7
tox.ini View File

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

Loading…
Cancel
Save