mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
kvm_net: remove unused function 'find_vms_tap'
This commit is contained in:
parent
db211fc72f
commit
e87d3a6b3c
@ -103,27 +103,7 @@ def list_pids():
|
||||
pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE)
|
||||
return pid.communicate()[0].split()
|
||||
|
||||
def find_vms_tap():
|
||||
''' Check if kvm is installed
|
||||
@return a list of pids from running kvm
|
||||
'''
|
||||
result = []
|
||||
tap = ""
|
||||
mac = ""
|
||||
kvm = Popen("ip a | grep -A 1 tap | awk '{print $2}' | grep -v '^$'", shell=True, stdout=PIPE)
|
||||
res = kvm.communicate()[0].split('\n')
|
||||
for line in res:
|
||||
try:
|
||||
if len(line) > 0:
|
||||
if re.match(r"^tap.*", line):
|
||||
tap = re.sub(r"(tap[^:]+):", r"\1", line)
|
||||
else:
|
||||
result.append(tap)
|
||||
except Exception as inst:
|
||||
continue
|
||||
|
||||
return result
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] in ['autoconf', 'detect']:
|
||||
|
Loading…
Reference in New Issue
Block a user