diff options
author | afunix <p.malishev@gmail.com> | 2016-08-31 08:27:07 +0300 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2016-08-31 07:27:07 +0200 |
commit | f69d32ec44d635925830b6ba0d14fe8639062e1c (patch) | |
tree | 095b15ba3ea4eb7370ef79a15fafcf63f380f4b8 /system/gluster_volume.py | |
parent | 1c4f346691654b47084fc932aae5dce79e0d3dd5 (diff) | |
download | ansible-modules-extras-f69d32ec44d635925830b6ba0d14fe8639062e1c.tar.gz |
gluster_volume module parses out additional hostnames provided by "gluster peer status" command [#1405] (#2811)
Diffstat (limited to 'system/gluster_volume.py')
-rw-r--r-- | system/gluster_volume.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/system/gluster_volume.py b/system/gluster_volume.py index f7fae041..9df9bce1 100644 --- a/system/gluster_volume.py +++ b/system/gluster_volume.py @@ -181,16 +181,24 @@ def get_peers(): hostname = None uuid = None state = None + shortNames = False for row in out.split('\n'): if ': ' in row: key, value = row.split(': ') if key.lower() == 'hostname': hostname = value + shortNames = False if key.lower() == 'uuid': uuid = value if key.lower() == 'state': state = value peers[hostname] = [ uuid, state ] + elif row.lower() == 'other names:': + shortNames = True + elif row != '' and shortNames == True: + peers[row] = [ uuid, state ] + elif row == '': + shortNames = False return peers def get_volumes(): |