Projet

Général

Profil

Révision e87d3a6b

IDe87d3a6b3c0fad8f76b9ea1839b04e728ab5235b
Parent db211fc7
Enfant 7f98e21f

Ajouté par Lars Kruse il y a plus de 7 ans

kvm_net: remove unused function 'find_vms_tap'

Voir les différences:

plugins/libvirt/kvm_net
103 103
    pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE)
104 104
    return pid.communicate()[0].split()
105 105

  
106
def find_vms_tap():
107
    ''' Check if kvm is installed
108
    @return a list of pids from running kvm
109
    '''
110
    result = []
111
    tap = ""
112
    mac = ""
113
    kvm = Popen("ip a | grep -A 1 tap | awk '{print $2}' | grep -v '^$'", shell=True, stdout=PIPE)
114
    res = kvm.communicate()[0].split('\n')
115
    for line in res:
116
        try:
117
            if len(line) > 0:
118
                if re.match(r"^tap.*", line):
119
                    tap = re.sub(r"(tap[^:]+):", r"\1", line)
120
                else:
121
                    result.append(tap)
122
        except Exception as inst:
123
            continue
124 106

  
125
    return result
126
    
127 107
if __name__ == "__main__":
128 108
    if len(sys.argv) > 1:
129 109
        if sys.argv[1] in ['autoconf', 'detect']:

Formats disponibles : Unified diff