diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-07-12 09:37:07 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-07-12 09:37:07 -0500 |
commit | 735f443c05550140edd56438a30b7525842734c5 (patch) | |
tree | 2c20b6983b5841e929344f14e0d9b25cbcdf88d9 | |
parent | 495ddff280a1d2d83a6483c027ffc19aa363f0e9 (diff) | |
download | cxmanage-735f443c05550140edd56438a30b7525842734c5.tar.gz |
target: Sort ipinfo and macaddrs before returning
-rw-r--r-- | cxmanage/target.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cxmanage/target.py b/cxmanage/target.py index 6296383..4636713 100644 --- a/cxmanage/target.py +++ b/cxmanage/target.py @@ -96,6 +96,7 @@ class Target: address = elements[2] if address != "0.0.0.0": results.append((node, address)) + results.sort() # Make sure we found something if len(results) == 0: @@ -131,7 +132,7 @@ class Target: if not os.path.exists(filename): raise CxmanageError("Failed to retrieve mac addresses") - # Parse addresses from ipinfo file + # Parse addresses from macaddrs file results = [] for line in open(filename): if line.startswith("Node"): @@ -140,6 +141,7 @@ class Target: port = int(elements[3].rstrip(":")) address = elements[4] results.append((node, port, address)) + results.sort() # Make sure we found something if len(results) == 0: @@ -185,7 +187,7 @@ class Target: raise CxmanageError("Failed to send MC reset command") def get_sensors(self): - """ Get a list of sensor (name, reading) tuples from this target """ + """ Get a list of sensors from this target """ try: return self.bmc.sdr_list() except IpmiError: |