Browse Source

Fixed hiera command to output correct DB hostnames

hiera_cmd used to output internal node names like "node-$i"
even if there are user-defined hostnames set. This breaks
DB-related checks when hostnames are customized.
The fix is to return not "database_nodes" keys, but
the value of "name" key in each "database_nodes"
subhash.

Change-Id: I9fbcfc270ab17d6302ce0a785c96f5b44fc9e75d
Co-Authored-By: Omar Rivera <gr113x@att.com>
Closes-Bug: #1582800
tags/10.0.0b1
Dmitry Nikishov 3 years ago
parent
commit
43a58efbaf
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      fuel_health/tests/ha/test_mysql_status.py

+ 4
- 2
fuel_health/tests/ha/test_mysql_status.py View File

@@ -59,9 +59,11 @@ class BaseMysqlTest(BaseTestCase):
59 59
                                key_filename=key,
60 60
                                timeout=100)
61 61
 
62
-        hiera_cmd = ('ruby -e \'require "hiera";'
63
-                     'db = Hiera.new().lookup("database_nodes", {}, {}).keys;'
62
+        hiera_cmd = ('ruby -e \'require "hiera"; '
63
+                     'db_h = Hiera.new().lookup("database_nodes", {}, {}); '
64
+                     'db = db_h.keys.map{|k| db_h[k]["name"]}; '
64 65
                      'if db != [] then puts db else puts "None" end\'')
66
+
65 67
         database_nodes = ssh_client.exec_command(hiera_cmd)
66 68
         # get online nodes
67 69
         database_nodes = database_nodes.splitlines()

Loading…
Cancel
Save