MCPcopy Create free account
hub / github.com/apache/cloudstack / getEnslavedDev

Method getEnslavedDev

python/lib/cloudutils/networkConfig.py:126–135  ·  view source on GitHub ↗
(br, brPort)

Source from the content-addressed store, hash-verified

124
125 @staticmethod
126 def getEnslavedDev(br, brPort):
127 if not networkConfig.isBridgeEnslavedWithDevices(br):
128 return None
129
130 for dev in os.listdir("/sys/class/net/%s/brif"%br):
131 br_port = int(open("/sys/class/net/%s/brif/%s/port_no"%(br,dev)).readline().strip("\n"), 16)
132 if br_port == brPort:
133 return dev
134
135 return None
136
137 @staticmethod
138 def getDevInfo(dev):

Callers 1

cfgNetworkMethod · 0.80

Calls 3

intFunction · 0.85
readlineMethod · 0.80

Tested by

no test coverage detected