From e87d3a6b3c0fad8f76b9ea1839b04e728ab5235b Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Sun, 10 Jun 2018 17:30:27 +0200 Subject: [PATCH] kvm_net: remove unused function 'find_vms_tap' --- plugins/libvirt/kvm_net | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/plugins/libvirt/kvm_net b/plugins/libvirt/kvm_net index bca7b7f3..c9f1d93d 100755 --- a/plugins/libvirt/kvm_net +++ b/plugins/libvirt/kvm_net @@ -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']: