X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=testsuites%2Fvstf%2Fvstf_scripts%2Fvstf%2Fagent%2Fenv%2Ffsmonitor%2Futils.py;h=c28b6ec6dc4e05978f8f68a5c334edea26f8f434;hb=6204bfbe6228d5167bdb67c42cac4c884cdcf664;hp=5bdb41598ee5af2d8005a302a67a864aba8a0ec5;hpb=3ac496ac711f40f2a4c4fb0837758b4fbade43e4;p=bottlenecks.git diff --git a/testsuites/vstf/vstf_scripts/vstf/agent/env/fsmonitor/utils.py b/testsuites/vstf/vstf_scripts/vstf/agent/env/fsmonitor/utils.py index 5bdb4159..c28b6ec6 100644 --- a/testsuites/vstf/vstf_scripts/vstf/agent/env/fsmonitor/utils.py +++ b/testsuites/vstf/vstf_scripts/vstf/agent/env/fsmonitor/utils.py @@ -70,6 +70,7 @@ def umount(path): class IPCommandHelper(object): + def __init__(self): self.devices = [] self.macs = [] @@ -80,7 +81,9 @@ class IPCommandHelper(object): self.mac_bdf_map = {} self.bdf_mac_map = {} buf = check_output("ip link", shell=True) - macs = re.compile("[A-F0-9]{2}(?::[A-F0-9]{2}){5}", re.IGNORECASE | re.MULTILINE) + macs = re.compile( + "[A-F0-9]{2}(?::[A-F0-9]{2}){5}", + re.IGNORECASE | re.MULTILINE) for mac in macs.findall(buf): if mac.lower() in ('00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff'): continue @@ -95,7 +98,10 @@ class IPCommandHelper(object): self.mac_device_map[mac] = device for device in self.devices: buf = check_output("ethtool -i %s" % device, shell=True) - bdfs = re.findall(r'^bus-info: \d{4}:(\d{2}:\d{2}\.\d*)$', buf, re.MULTILINE) + bdfs = re.findall( + r'^bus-info: \d{4}:(\d{2}:\d{2}\.\d*)$', + buf, + re.MULTILINE) if bdfs: self.bdf_device_map[bdfs[0]] = device self.device_bdf_map[device] = bdfs[0]