diff options
author | Tyler Mock <tyler.mock@calxeda.com> | 2013-04-26 12:40:06 -0500 |
---|---|---|
committer | Tyler Mock <tyler.mock@calxeda.com> | 2013-04-26 12:40:06 -0500 |
commit | 405302107d8de4b4992547c2fb5e03d82d106017 (patch) | |
tree | 004492869ce19f730fc167f8f976d3a6196d37af | |
parent | 0f0a8736c50a1d40ee0f4f667ac750ad42c10249 (diff) | |
download | cxmanage-405302107d8de4b4992547c2fb5e03d82d106017.tar.gz |
Changed parsing of get_fabric_depth_chart() output
-rw-r--r-- | cxmanage_api/node.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py index 6a4e3c0..4ca8eec 100644 --- a/cxmanage_api/node.py +++ b/cxmanage_api/node.py @@ -1224,15 +1224,19 @@ class Node(object): target = int(elements[1].rstrip(':')) neighbor = int(elements[8].rstrip(':')) hops = int(elements[4].strip()) - dchrt_entries = [] + dchrt_entries = {} + dchrt_entries['shortest'] = (neighbor, hops) try: other_hops_neighbors = elements[12].strip().split('[,\s]+') + hops = [] for entry in other_hops_neighbors: pair = entry.strip().split('/') - dchrt_entries.append((int(pair[1]), int(pair[0]))) - results[target] = (neighbor, hops), dchrt_entries + hops.append((int(pair[1]), int(pair[0]))) + dchrt_entries['hops'] = hops except: - results[target] = (neighbor, hops) + pass + + results[target] = dchrt_entries # Make sure we found something if (not results): |