X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=resources%2Fcommons%2FshowOvsdbMdsal.py;h=3d566eb22fb7747feee4107cd6cbf7cd6ab934c6;hb=bdc747f048e97932df141c4259a09bb0d167e1bb;hp=864cb08366222e4ae402c15779f76f9275cf4079;hpb=bbacf488d75f6eb6b71725f9118e20428e02630c;p=netvirt.git diff --git a/resources/commons/showOvsdbMdsal.py b/resources/commons/showOvsdbMdsal.py index 864cb08366..3d566eb22f 100755 --- a/resources/commons/showOvsdbMdsal.py +++ b/resources/commons/showOvsdbMdsal.py @@ -139,6 +139,16 @@ class OvsdbNode: # ====================================================================== +def make_it_a_string(param): + result = "" + try: + result = str( param ) + except: + pass + return result + +# ====================================================================== + def printError(msg): sys.stderr.write(msg) @@ -345,8 +355,8 @@ def parseTopologyJsonNodeOvsdb(indent, mdsalTreeType, topologyId, nodeIndex, nod connectionInfoRaw = node.get('ovsdb:connection-info') connectionInfo = {} if type(connectionInfoRaw) is dict: - connectionInfo['inetMgr'] = connectionInfoRaw.get('local-ip') + ':' + str( connectionInfoRaw.get('local-port') ) - connectionInfo['inetNode'] = connectionInfoRaw.get('remote-ip') + ':' + str( connectionInfoRaw.get('remote-port') ) + connectionInfo['inetMgr'] = make_it_a_string(connectionInfoRaw.get('local-ip')) + ':' + make_it_a_string(connectionInfoRaw.get('local-port')) + connectionInfo['inetNode'] = make_it_a_string(connectionInfoRaw.get('remote-ip')) + ':' + make_it_a_string(connectionInfoRaw.get('remote-port')) otherConfigsRaw = node.get('ovsdb:openvswitch-other-configs') otherLocalIp = '' if type(otherConfigsRaw) is list: