diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py index ca6237f1713..1147f5b6ec9 100755 --- a/scripts/vm/network/security_group.py +++ b/scripts/vm/network/security_group.py @@ -1371,13 +1371,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) diff --git a/test/integration/component/test_multiple_nic_support.py b/test/integration/component/test_multiple_nic_support.py index 55e01097fba..fc1c1f47ac4 100644 --- a/test/integration/component/test_multiple_nic_support.py +++ b/test/integration/component/test_multiple_nic_support.py @@ -225,7 +225,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( @@ -244,7 +244,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) diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index a07ed635ba7..f2a0c61378d 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -186,6 +186,10 @@ export default { docHelp: 'adminguide/virtual_machines.html#virtual-machine-snapshots', dataView: true, popup: true, + show: (record) => { + return ((['Running'].includes(record.state) && record.hypervisor !== 'LXC') || + (['Stopped'].includes(record.state) && !['KVM', 'LXC'].includes(record.hypervisor))) + }, component: () => import('@/views/compute/CreateSnapshotWizard.vue') }, { diff --git a/ui/src/config/section/infra/primaryStorages.js b/ui/src/config/section/infra/primaryStorages.js index eda57176668..dc188000702 100644 --- a/ui/src/config/section/infra/primaryStorages.js +++ b/ui/src/config/section/infra/primaryStorages.js @@ -111,7 +111,8 @@ export default { label: 'label.action.delete.primary.storage', dataView: true, args: ['forced'], - show: (record) => { return (record.state === 'Down' || record.state === 'Maintenance' || record.state === 'Disconnected') } + show: (record) => { return (record.state === 'Down' || record.state === 'Maintenance' || record.state === 'Disconnected') }, + displayName: (record) => { return record.name || record.displayName || record.id } } ] } diff --git a/ui/src/config/section/infra/secondaryStorages.js b/ui/src/config/section/infra/secondaryStorages.js index 0c972259f8b..059dde8def5 100644 --- a/ui/src/config/section/infra/secondaryStorages.js +++ b/ui/src/config/section/infra/secondaryStorages.js @@ -87,7 +87,8 @@ export default { icon: 'delete', label: 'label.action.delete.secondary.storage', message: 'message.action.delete.secondary.storage', - dataView: true + dataView: true, + displayName: (record) => { return record.name || record.displayName || record.id } } ] }