Update showOvsdbMdsal.py to display bridge name and mac next to alias
authorFlavio Fernandes <ffernand@redhat.com>
Mon, 20 Jul 2015 22:49:53 +0000 (18:49 -0400)
committerFlavio Fernandes <ffernand@redhat.com>
Mon, 20 Jul 2015 22:49:53 +0000 (18:49 -0400)
Change-Id: Ida68f52803737eb06bda03bbcc4ccf36758ab046
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
resources/commons/showOvsdbMdsal.py

index 05102cb7d6016a9f20a0db575c6b89ba1fdc5041..864cb08366222e4ae402c15779f76f9275cf4079 100755 (executable)
@@ -459,13 +459,10 @@ def showPrettyNamesMap():
     prtLn('aliasMap:', 0)
     resultMap = {}
     for bridge in state.bridgeNodes.values():
-        resultMap[ bridge.alias ] = bridge.getOpenflowName()
+        resultMap[ bridge.alias ] = '{0: <25} {1: <7} {2}'.format(bridge.getOpenflowName(), bridge.name, bridge.dpId)
 
-    resultMapKeys = resultMap.keys()
-    resultMapKeys.sort()
-
-    for resultMapKey in resultMapKeys:
-        prtLn('{0}{1: <10} -> {2}'.format(spc, resultMapKey, resultMap[resultMapKey]), 0)
+    for resultMapKey in sorted(resultMap):
+        prtLn('{0}{1: <10} ->  {2}'.format(spc, resultMapKey, resultMap[resultMapKey]), 0)
     prtLn('', 0)
 
 # --