summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Mock <tyler.mock@calxeda.com>2013-04-26 12:40:06 -0500
committerTyler Mock <tyler.mock@calxeda.com>2013-04-26 12:40:06 -0500
commit405302107d8de4b4992547c2fb5e03d82d106017 (patch)
tree004492869ce19f730fc167f8f976d3a6196d37af
parent0f0a8736c50a1d40ee0f4f667ac750ad42c10249 (diff)
downloadcxmanage-405302107d8de4b4992547c2fb5e03d82d106017.tar.gz
Changed parsing of get_fabric_depth_chart() output
-rw-r--r--cxmanage_api/node.py12
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):