Projet

Général

Profil

Révision 67cc769c

ID67cc769c87f01f273a65ea7613543b3c6ebedb9d
Parent f6080f5f
Enfant 3267bbd0

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

kvm_net: use print function for python3-compatibility

Voir les différences:

plugins/libvirt/kvm_net
30 30
graph_info This graph shows the network I/O of the virtual machines
31 31
graph_args --base 1024
32 32
    """
33
    print base_config
33
    print(base_config)
34 34
    for vm in vm_names:
35
        print "%s_in.label %s" % (vm, vm)
36
        print "%s_in.type COUNTER" % vm
37
        print "%s_in.min 0" % vm
38
        print "%s_in.draw LINE2" % vm
39
        print "%s_out.negative %s_in" % (vm, vm)
40
        print "%s_out.label %s" % (vm, vm)
41
        print "%s_out.type COUNTER" % vm
42
        print "%s_out.min 0" % vm
43
        print "%s_out.draw LINE2" % vm
35
        print("%s_in.label %s" % (vm, vm))
36
        print("%s_in.type COUNTER" % vm)
37
        print("%s_in.min 0" % vm)
38
        print("%s_in.draw LINE2" % vm)
39
        print("%s_out.negative %s_in" % (vm, vm))
40
        print("%s_out.label %s" % (vm, vm))
41
        print("%s_out.type COUNTER" % vm)
42
        print("%s_out.min 0" % vm)
43
        print("%s_out.draw LINE2" % vm)
44 44

  
45 45

  
46 46
def clean_vm_name(vm_name):
......
68 68
            f = open("/proc/net/dev", "r")
69 69
            for line in f.readlines():
70 70
                if tap in line:
71
                    print "%s_in.value %s" % (vms[pid], line.split()[1])
72
                    print "%s_out.value %s" % (vms[pid], line.split()[9])
71
                    print("%s_in.value %s" % (vms[pid], line.split()[1]))
72
                    print("%s_out.value %s" % (vms[pid], line.split()[9]))
73 73
                    break
74 74
        except Exception as inst:
75
            print inst
75
            print(inst)
76 76
            continue
77 77

  
78 78

  
......
119 119
    if len(sys.argv) > 1:
120 120
        if sys.argv[1] in ["autoconf", "detect"]:
121 121
            if detect_kvm():
122
                print "yes"
122
                print("yes")
123 123
            else:
124
                print "no"
124
                print("no")
125 125
        elif sys.argv[1] == "config":
126 126
            config(find_vm_names(list_pids()).values())
127 127
        else:

Formats disponibles : Unified diff