Skip to content

Commit f822547

Browse files
securitygroups: Fix security_groups for c8/suse (#5354)
* Fix security_groups for c8/suse * security_group.py: revert a minor change in #5348 Co-authored-by: Wei Zhou <[email protected]>
1 parent bc28ae4 commit f822547

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/vm/network/security_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,13 +1369,13 @@ def verify_network_rules(vm_name, vm_id, vm_ip, vm_ip6, vm_mac, vif, brname, sec
13691369
vm_id = vm_name.split("-")[-2]
13701370

13711371
if brname is None:
1372-
brname = execute("virsh domiflist %s |grep -w '%s' |tr -s ' '|cut -d ' ' -f3" % (vm_name, vm_mac)).strip()
1372+
brname = execute("virsh domiflist %s |grep -w '%s' | awk '{print $3}'" % (vm_name, vm_mac)).strip()
13731373
if not brname:
13741374
print("Cannot find bridge")
13751375
sys.exit(1)
13761376

13771377
if vif is None:
1378-
vif = execute("virsh domiflist %s |grep -w '%s' |tr -s ' '|cut -d ' ' -f1" % (vm_name, vm_mac)).strip()
1378+
vif = execute("virsh domiflist %s |grep -w '%s' | awk '{print $1}'" % (vm_name, vm_mac)).strip()
13791379
if not vif:
13801380
print("Cannot find vif")
13811381
sys.exit(1)

test/integration/component/test_multiple_nic_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def setUpClass(cls):
224224
cls.virtual_machine1.default_network_id = nic.networkid
225225
break
226226
except Exception as e:
227-
cls.fail(f"Exception while deploying virtual machine: {e}")
227+
cls.fail("Exception while deploying virtual machine: %s" % {e})
228228

229229
try:
230230
cls.virtual_machine2 = VirtualMachine.create(
@@ -243,7 +243,7 @@ def setUpClass(cls):
243243
cls.virtual_machine2.default_network_id = nic.networkid
244244
break
245245
except Exception as e:
246-
cls.fail(f"Exception while deploying virtual machine: {e}")
246+
cls.fail("Exception while deploying virtual machine: %s" % {e})
247247

248248
cls._cleanup.append(cls.virtual_machine1)
249249
cls._cleanup.append(cls.virtual_machine2)

0 commit comments

Comments
 (0)