@@ -51,9 +51,7 @@ def get_vm_uuids(dynamic_only):
51
51
return vm_uuids
52
52
53
53
54
- def change_network_adapters_to_hostonly (
55
- vm_uuid , vm_name , hostonly_ifname , do_not_modify
56
- ):
54
+ def change_network_adapters_to_hostonly (vm_uuid , vm_name , hostonly_ifname , do_not_modify ):
57
55
"""Verify all adapters are in an allowed configuration. Must be poweredoff"""
58
56
try :
59
57
# gather adapters in incorrect configurations
@@ -72,9 +70,7 @@ def change_network_adapters_to_hostonly(
72
70
# nic8="none"
73
71
74
72
vminfo = run_vboxmanage (["showvminfo" , vm_uuid , "--machinereadable" ])
75
- for nic_number , nic_value in re .findall (
76
- '^nic(\d+)="(\S+)"' , vminfo , flags = re .M
77
- ):
73
+ for nic_number , nic_value in re .findall ('^nic(\d+)="(\S+)"' , vminfo , flags = re .M ):
78
74
if nic_value not in ALLOWED_ADAPTER_TYPES :
79
75
nics_with_internet .append (f"nic{ nic_number } " )
80
76
invalid_nics_msg += f"{ nic_number } "
@@ -115,9 +111,7 @@ def change_network_adapters_to_hostonly(
115
111
116
112
# Show notification using PyGObject
117
113
Notify .init ("VirtualBox adapter check" )
118
- notification = Notify .Notification .new (
119
- f"INTERNET IN VM: { vm_name } " , message , "dialog-error"
120
- )
114
+ notification = Notify .Notification .new (f"INTERNET IN VM: { vm_name } " , message , "dialog-error" )
121
115
# Set highest priority
122
116
notification .set_urgency (2 )
123
117
notification .show ()
@@ -167,9 +161,7 @@ def main(argv=None):
167
161
vm_uuids = get_vm_uuids (args .dynamic_only )
168
162
if len (vm_uuids ) > 0 :
169
163
for vm_name , vm_uuid in vm_uuids :
170
- change_network_adapters_to_hostonly (
171
- vm_uuid , vm_name , hostonly_ifname , args .do_not_modify
172
- )
164
+ change_network_adapters_to_hostonly (vm_uuid , vm_name , hostonly_ifname , args .do_not_modify )
173
165
else :
174
166
print (f"[Warning ⚠️] No VMs found" )
175
167
except Exception as e :
0 commit comments