diff options
| author | James Shubin <james@shubin.ca> | 2013-12-28 16:40:46 -0500 |
|---|---|---|
| committer | James Shubin <james@shubin.ca> | 2013-12-28 16:54:43 -0500 |
| commit | a8d2d9f73e66670e5b9ef1ebff84cc2eb14da603 (patch) | |
| tree | 9c3b3694d67e4510ce30c26e49a7b3f7a295e4fd | |
| parent | fcd9ec7f5d868753145027e764add098c0a98c46 (diff) | |
| download | puppet-gluster-a8d2d9f73e66670e5b9ef1ebff84cc2eb14da603.tar.gz puppet-gluster-a8d2d9f73e66670e5b9ef1ebff84cc2eb14da603.tar.xz puppet-gluster-a8d2d9f73e66670e5b9ef1ebff84cc2eb14da603.zip | |
Properly iterate over all the peers.
Not sure how this bug ever happened. Did the format of the xml ever
change? In any case, now it's squashed.
| -rw-r--r-- | files/xml.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/files/xml.py b/files/xml.py index c072819..b75906f 100644 --- a/files/xml.py +++ b/files/xml.py @@ -97,8 +97,11 @@ if args.mode == 'connected': store = {} peers = args.peers - for i in root.findall('.//peerStatus'): - p = i.find('peer') + l = root.findall('.//peerStatus') + if len(l) != 1: + sys.exit(3) + + for p in l[0].findall('.//peer'): h = p.find('hostname').text c = (str(p.find('connected').text) == '1') # connected...? s = (str(p.find('state').text) in VALID_PEERED) # valid peering |
