mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.14' into 4.15
This commit is contained in:
commit
f5a44b3502
@ -28,13 +28,10 @@ def merge(dbag, data):
|
||||
else:
|
||||
remove_keys = set()
|
||||
for key, entry in dbag.iteritems():
|
||||
if key != 'id' and entry['mac_address'] == data['mac_address']:
|
||||
if key != 'id' and entry['mac_address'] == data['mac_address'] and data['remove']:
|
||||
remove_keys.add(key)
|
||||
break
|
||||
|
||||
if data['remove'] and key not in remove_keys:
|
||||
remove_keys.add(key)
|
||||
|
||||
for remove_key in remove_keys:
|
||||
del(dbag[remove_key])
|
||||
|
||||
|
||||
@ -502,6 +502,23 @@ class TestServiceOfferings(cloudstackTestCase):
|
||||
self.skipTest("Skipping this test for {} due to bug CS-38153".format(self.hypervisor))
|
||||
try:
|
||||
self.medium_virtual_machine.stop(self.apiclient)
|
||||
timeout = self.services["timeout"]
|
||||
while True:
|
||||
time.sleep(self.services["sleep"])
|
||||
# Ensure that VM is in stopped state
|
||||
list_vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=self.medium_virtual_machine.id
|
||||
)
|
||||
if isinstance(list_vm_response, list):
|
||||
vm = list_vm_response[0]
|
||||
if vm.state == 'Stopped':
|
||||
self.debug("VM state: %s" % vm.state)
|
||||
break
|
||||
if timeout == 0:
|
||||
raise Exception(
|
||||
"Failed to stop VM (ID: %s) in change service offering" % vm.id)
|
||||
timeout = timeout - 1
|
||||
except Exception as e:
|
||||
self.fail("Failed to stop VM: %s" % e)
|
||||
|
||||
|
||||
@ -457,6 +457,30 @@ class TestChangeServiceOfferingForVmWithSnapshots(cloudstackTestCase):
|
||||
self.debug("Stopping VM - ID: %s" % virtual_machine.id)
|
||||
try:
|
||||
virtual_machine.stop(self.apiclient)
|
||||
timeout = self.services["timeout"]
|
||||
|
||||
while True:
|
||||
time.sleep(self.services["sleep"])
|
||||
|
||||
# Ensure that VM is in stopped state
|
||||
list_vm_response = list_virtual_machines(
|
||||
self.apiclient,
|
||||
id=virtual_machine.id
|
||||
)
|
||||
|
||||
if isinstance(list_vm_response, list):
|
||||
|
||||
vm = list_vm_response[0]
|
||||
if vm.state == 'Stopped':
|
||||
self.debug("VM state: %s" % vm.state)
|
||||
break
|
||||
|
||||
if timeout == 0:
|
||||
raise Exception(
|
||||
"Failed to stop VM (ID: %s) in change service offering" % vm.id)
|
||||
|
||||
timeout = timeout - 1
|
||||
|
||||
except Exception as e:
|
||||
self.fail("Failed to stop VM: %s" % e)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user