mirror of https://github.com/apache/cloudstack.git
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 <weizhou@apache.org>
This commit is contained in:
parent
bc28ae4606
commit
f822547c3b
|
|
@ -1369,13 +1369,13 @@ def verify_network_rules(vm_name, vm_id, vm_ip, vm_ip6, vm_mac, vif, brname, sec
|
|||
vm_id = vm_name.split("-")[-2]
|
||||
|
||||
if brname is None:
|
||||
brname = execute("virsh domiflist %s |grep -w '%s' |tr -s ' '|cut -d ' ' -f3" % (vm_name, vm_mac)).strip()
|
||||
brname = execute("virsh domiflist %s |grep -w '%s' | awk '{print $3}'" % (vm_name, vm_mac)).strip()
|
||||
if not brname:
|
||||
print("Cannot find bridge")
|
||||
sys.exit(1)
|
||||
|
||||
if vif is None:
|
||||
vif = execute("virsh domiflist %s |grep -w '%s' |tr -s ' '|cut -d ' ' -f1" % (vm_name, vm_mac)).strip()
|
||||
vif = execute("virsh domiflist %s |grep -w '%s' | awk '{print $1}'" % (vm_name, vm_mac)).strip()
|
||||
if not vif:
|
||||
print("Cannot find vif")
|
||||
sys.exit(1)
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ class TestMulipleNicSupport(cloudstackTestCase):
|
|||
cls.virtual_machine1.default_network_id = nic.networkid
|
||||
break
|
||||
except Exception as e:
|
||||
cls.fail(f"Exception while deploying virtual machine: {e}")
|
||||
cls.fail("Exception while deploying virtual machine: %s" % {e})
|
||||
|
||||
try:
|
||||
cls.virtual_machine2 = VirtualMachine.create(
|
||||
|
|
@ -243,7 +243,7 @@ class TestMulipleNicSupport(cloudstackTestCase):
|
|||
cls.virtual_machine2.default_network_id = nic.networkid
|
||||
break
|
||||
except Exception as e:
|
||||
cls.fail(f"Exception while deploying virtual machine: {e}")
|
||||
cls.fail("Exception while deploying virtual machine: %s" % {e})
|
||||
|
||||
cls._cleanup.append(cls.virtual_machine1)
|
||||
cls._cleanup.append(cls.virtual_machine2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue