mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
kvm_net: simplify argument handling
This commit is contained in:
parent
89e4dd6420
commit
54330cc3e6
@ -135,15 +135,15 @@ def list_pids():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] in ["autoconf", "detect"]:
|
||||
if detect_kvm():
|
||||
print("yes")
|
||||
else:
|
||||
print("no")
|
||||
elif sys.argv[1] == "config":
|
||||
config(find_vm_names(list_pids()).values())
|
||||
action = sys.argv[1] if len(sys.argv) > 1 else None
|
||||
if action == "autoconf":
|
||||
if detect_kvm():
|
||||
print("yes")
|
||||
else:
|
||||
fetch(find_vm_names(list_pids()))
|
||||
print("no")
|
||||
elif action == "config":
|
||||
vm_data = find_vm_names(list_pids())
|
||||
config(vm_data.values())
|
||||
else:
|
||||
fetch(find_vm_names(list_pids()))
|
||||
vm_data = find_vm_names(list_pids())
|
||||
fetch(vm_data)
|
||||
|
Loading…
Reference in New Issue
Block a user