Browse Source

NovaCompute: Support parsing host option from /etc/nova/nova.conf.d

Change-Id: Ic08f05d217e1321ee7d3feec4d12bf32593e7982
Vincent Untz 2 years ago
parent
commit
fe84d75954
1 changed files with 17 additions and 2 deletions
  1. 17
    2
      ocf/NovaCompute

+ 17
- 2
ocf/NovaCompute View File

@@ -324,8 +324,23 @@ nova_validate() {
324 324
     # or configured in nova.conf
325 325
 
326 326
     local validate_host=1
327
-    NOVA_HOST=$(crudini --get /etc/nova/nova.conf DEFAULT host 2>/dev/null)
328
-    if [ $? = 1 ]; then
327
+    local conf_file
328
+    NOVA_HOST=
329
+
330
+    for conf_file in /etc/nova/nova.conf /etc/nova/nova.conf.d/*; do
331
+        local parsed_value
332
+
333
+        if [ ! -f "$conf_file" ]; then
334
+            continue
335
+        fi
336
+
337
+        parsed_value=$(crudini --get "$conf_file" DEFAULT host 2>/dev/null)
338
+        if [ $? = 0 ]; then
339
+            NOVA_HOST="$parsed_value"
340
+        fi
341
+    done
342
+
343
+    if [ -z "$NOVA_HOST" ]; then
329 344
         if [ "x${OCF_RESKEY_domain}" != x ]; then
330 345
             NOVA_HOST=$(uname -n | awk -F. '{print $1}')
331 346
         else

Loading…
Cancel
Save