Browse code

Merge "Set the rabbit_durable_queues to match local consumers"

Jenkins authored on 2012/11/10 04:23:16
Showing 1 changed files
... ...
@@ -70,6 +70,13 @@ function configure_glanceclient() {
70 70
     setup_develop $GLANCECLIENT_DIR
71 71
 }
72 72
 
73
+# durable_glance_queues() - Determine if RabbitMQ queues are durable or not
74
+function durable_glance_queues() {
75
+    test `rabbitmqctl list_queues name durable | grep true | wc -l` -gt 0 && return 0
76
+    test `rabbitmqctl list_exchanges name durable | grep true | wc -l` -gt 0 && return 0
77
+    return 1
78
+}
79
+
73 80
 # configure_glance() - Set config files, create data dirs, etc
74 81
 function configure_glance() {
75 82
     setup_develop $GLANCE_DIR
... ...
@@ -120,6 +127,12 @@ function configure_glance() {
120 120
         iniset $GLANCE_API_CONF DEFAULT notifier_strategy rabbit
121 121
         iniset $GLANCE_API_CONF DEFAULT rabbit_host $RABBIT_HOST
122 122
         iniset $GLANCE_API_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
123
+        if [[ durable_glance_queues -eq 0 ]]; then
124
+            # This gets around https://bugs.launchpad.net/glance/+bug/1074132
125
+            # that results in a g-api server becoming unresponsive during
126
+            # startup...
127
+            iniset $GLANCE_API_CONF DEFAULT rabbit_durable_queues True
128
+        fi
123 129
     fi
124 130
     if [[ "$KEYSTONE_TOKEN_FORMAT" == "PKI" ]]; then
125 131
         iniset $GLANCE_API_CONF keystone_authtoken signing_dir $GLANCE_AUTH_CACHE_DIR/api