wrapanapi 4.0.3__tar.gz → 4.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/PKG-INFO +2 -2
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/vm.py +3 -3
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/container/rhopenshift.py +2 -2
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/google.py +9 -9
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/msazure.py +30 -22
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/openstack.py +8 -8
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/rhevm.py +10 -10
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/scvmm.py +2 -2
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/virtualcenter.py +4 -2
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/.gitignore +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/LICENSE +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/README.rst +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/pyproject.toml +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/clients/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/clients/rest_client.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/clients/websocket_client.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/const.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/base.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/instance.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/network.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/physical_container.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/server.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/stack.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/template.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/entities/volume.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/exceptions.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/base.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/container/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/container/podman.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/ec2.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/hawkular.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/lenovo.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/nuage.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/openstack_infra.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/redfish.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/systems/vcloud.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/utils/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/utils/json_utils.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/utils/logger_mixin.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.5}/wrapanapi/utils/random.py +0 -0
|
@@ -183,7 +183,7 @@ class Vm(Entity, metaclass=ABCMeta):
|
|
|
183
183
|
Returns creation time of VM/instance
|
|
184
184
|
"""
|
|
185
185
|
|
|
186
|
-
def wait_for_state(self, state, timeout=
|
|
186
|
+
def wait_for_state(self, state, timeout=6 * 60, delay=15):
|
|
187
187
|
"""
|
|
188
188
|
Waits for a VM to be in the desired state
|
|
189
189
|
|
|
@@ -260,7 +260,7 @@ class Vm(Entity, metaclass=ABCMeta):
|
|
|
260
260
|
message=f"ensure vm {self._log_id} reaches state '{state}'",
|
|
261
261
|
)
|
|
262
262
|
|
|
263
|
-
def ensure_state(self, state, timeout=
|
|
263
|
+
def ensure_state(self, state, timeout=6 * 60, delay=5):
|
|
264
264
|
"""
|
|
265
265
|
Perform the actions required to get the VM to the desired state.
|
|
266
266
|
|
|
@@ -365,7 +365,7 @@ class Vm(Entity, metaclass=ABCMeta):
|
|
|
365
365
|
Waits for the system's steady_wait_time for VM to reach a steady state
|
|
366
366
|
|
|
367
367
|
Args:
|
|
368
|
-
|
|
368
|
+
timeout: Time to wait to override default steady_wait_time
|
|
369
369
|
"""
|
|
370
370
|
try:
|
|
371
371
|
return wait_for(
|
|
@@ -893,7 +893,7 @@ class Openshift(System):
|
|
|
893
893
|
|
|
894
894
|
return self.wait_job_finished(namespace, job_name)
|
|
895
895
|
|
|
896
|
-
def wait_job_finished(self, namespace, name, wait=
|
|
896
|
+
def wait_job_finished(self, namespace, name, wait=15 * 60):
|
|
897
897
|
"""Waits for job to accomplish
|
|
898
898
|
|
|
899
899
|
Args:
|
|
@@ -913,7 +913,7 @@ class Openshift(System):
|
|
|
913
913
|
|
|
914
914
|
return wait_for(job_wait_accomplished, timeout=wait)[0]
|
|
915
915
|
|
|
916
|
-
def wait_persistent_volume_claim_status(self, namespace, name, status, wait=
|
|
916
|
+
def wait_persistent_volume_claim_status(self, namespace, name, status, wait=60):
|
|
917
917
|
"""Waits until pvc gets some particular status.
|
|
918
918
|
For example: Bound.
|
|
919
919
|
|
|
@@ -156,7 +156,7 @@ class GoogleCloudInstance(Instance):
|
|
|
156
156
|
wait_for(
|
|
157
157
|
lambda: self.system.is_zone_operation_done(operation["name"], zone=self.zone),
|
|
158
158
|
delay=0.5,
|
|
159
|
-
|
|
159
|
+
timeout=timeout,
|
|
160
160
|
message=f"Delete {self.name}",
|
|
161
161
|
)
|
|
162
162
|
|
|
@@ -166,7 +166,7 @@ class GoogleCloudInstance(Instance):
|
|
|
166
166
|
wait_for(
|
|
167
167
|
lambda: not self.exists,
|
|
168
168
|
delay=0.5,
|
|
169
|
-
|
|
169
|
+
timeout=timeout,
|
|
170
170
|
message=f" instance '{self.name}' to not exist",
|
|
171
171
|
)
|
|
172
172
|
return True
|
|
@@ -220,7 +220,7 @@ class GoogleCloudInstance(Instance):
|
|
|
220
220
|
wait_for(
|
|
221
221
|
lambda: self.system.is_zone_operation_done(operation["name"]),
|
|
222
222
|
delay=0.5,
|
|
223
|
-
|
|
223
|
+
timeout=120,
|
|
224
224
|
message=f" Attach {disk_name}",
|
|
225
225
|
)
|
|
226
226
|
|
|
@@ -243,7 +243,7 @@ class GoogleCloudInstance(Instance):
|
|
|
243
243
|
wait_for(
|
|
244
244
|
lambda: self.system.is_zone_operation_done(operation["name"]),
|
|
245
245
|
delay=0.5,
|
|
246
|
-
|
|
246
|
+
timeout=120,
|
|
247
247
|
message=f" Set auto-delete {disk_name}",
|
|
248
248
|
)
|
|
249
249
|
|
|
@@ -303,13 +303,13 @@ class GoogleCloudImage(Template):
|
|
|
303
303
|
wait_for(
|
|
304
304
|
lambda: self.system.is_global_operation_done(operation["name"]),
|
|
305
305
|
delay=0.5,
|
|
306
|
-
|
|
306
|
+
timeout=timeout,
|
|
307
307
|
message=f" Deleting image {self.name}",
|
|
308
308
|
)
|
|
309
309
|
wait_for(
|
|
310
310
|
lambda: not self.exists,
|
|
311
311
|
delay=0.5,
|
|
312
|
-
|
|
312
|
+
timeout=timeout,
|
|
313
313
|
message=f" image '{self.name}' to not exist",
|
|
314
314
|
)
|
|
315
315
|
return True
|
|
@@ -416,7 +416,7 @@ class GoogleCloudImage(Template):
|
|
|
416
416
|
wait_for(
|
|
417
417
|
lambda: self.system.is_zone_operation_done(operation["name"]),
|
|
418
418
|
delay=0.5,
|
|
419
|
-
|
|
419
|
+
timeout=timeout,
|
|
420
420
|
message=f" Create {instance_name}",
|
|
421
421
|
)
|
|
422
422
|
instance = GoogleCloudInstance(system=self.system, name=instance_name, zone=zone)
|
|
@@ -762,7 +762,7 @@ class GoogleCloudSystem(System, TemplateMixin, VmMixin):
|
|
|
762
762
|
wait_for(
|
|
763
763
|
lambda: self.is_global_operation_done(operation["name"]),
|
|
764
764
|
delay=0.5,
|
|
765
|
-
|
|
765
|
+
timeout=timeout,
|
|
766
766
|
message=f" Creating image {name}",
|
|
767
767
|
)
|
|
768
768
|
return self.get_template(name, self._project)
|
|
@@ -792,7 +792,7 @@ class GoogleCloudSystem(System, TemplateMixin, VmMixin):
|
|
|
792
792
|
wait_for(
|
|
793
793
|
lambda: self.is_zone_operation_done(operation["name"]),
|
|
794
794
|
delay=0.5,
|
|
795
|
-
|
|
795
|
+
timeout=120,
|
|
796
796
|
message=f" Create {disk_name}",
|
|
797
797
|
)
|
|
798
798
|
|
|
@@ -241,7 +241,9 @@ class AzureInstance(Instance):
|
|
|
241
241
|
|
|
242
242
|
def delete(self):
|
|
243
243
|
self.logger.info("deleting vm '%s'", self.name)
|
|
244
|
-
operation = self._api.
|
|
244
|
+
operation = self._api.begin_delete(
|
|
245
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
246
|
+
)
|
|
245
247
|
return self._wait_on_operation(operation)
|
|
246
248
|
|
|
247
249
|
def cleanup(self):
|
|
@@ -265,7 +267,9 @@ class AzureInstance(Instance):
|
|
|
265
267
|
|
|
266
268
|
def start(self):
|
|
267
269
|
self.logger.info("starting vm '%s'", self.name)
|
|
268
|
-
operation = self._api.
|
|
270
|
+
operation = self._api.begin_start(
|
|
271
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
272
|
+
)
|
|
269
273
|
if self._wait_on_operation(operation):
|
|
270
274
|
self.wait_for_state(VmState.RUNNING)
|
|
271
275
|
return True
|
|
@@ -273,7 +277,7 @@ class AzureInstance(Instance):
|
|
|
273
277
|
|
|
274
278
|
def stop(self):
|
|
275
279
|
self.logger.info("stopping vm '%s'", self.name)
|
|
276
|
-
operation = self._api.
|
|
280
|
+
operation = self._api.begin_deallocate(
|
|
277
281
|
resource_group_name=self._resource_group, vm_name=self.name
|
|
278
282
|
)
|
|
279
283
|
if self._wait_on_operation(operation):
|
|
@@ -283,7 +287,9 @@ class AzureInstance(Instance):
|
|
|
283
287
|
|
|
284
288
|
def restart(self):
|
|
285
289
|
self.logger.info("restarting vm '%s'", self.name)
|
|
286
|
-
operation = self._api.
|
|
290
|
+
operation = self._api.begin_restart(
|
|
291
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
292
|
+
)
|
|
287
293
|
if self._wait_on_operation(operation):
|
|
288
294
|
self.wait_for_state(VmState.RUNNING)
|
|
289
295
|
return True
|
|
@@ -291,7 +297,9 @@ class AzureInstance(Instance):
|
|
|
291
297
|
|
|
292
298
|
def suspend(self):
|
|
293
299
|
self.logger.info("suspending vm '%s'", self.name)
|
|
294
|
-
operation = self._api.
|
|
300
|
+
operation = self._api.begin_power_off(
|
|
301
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
302
|
+
)
|
|
295
303
|
if self._wait_on_operation(operation):
|
|
296
304
|
self.wait_for_state(VmState.SUSPENDED)
|
|
297
305
|
return True
|
|
@@ -314,7 +322,7 @@ class AzureInstance(Instance):
|
|
|
314
322
|
)
|
|
315
323
|
self._wait_on_operation(operation)
|
|
316
324
|
self.logger.info("Capturing VM '%s'", self.name)
|
|
317
|
-
operation = self._api.
|
|
325
|
+
operation = self._api.begin_capture(
|
|
318
326
|
resource_group_name=self._resource_group,
|
|
319
327
|
vm_name=self.name,
|
|
320
328
|
parameters=params,
|
|
@@ -417,7 +425,7 @@ class AzureBlobImage(Template):
|
|
|
417
425
|
"location": location,
|
|
418
426
|
"public_ip_allocation_method": "Dynamic",
|
|
419
427
|
}
|
|
420
|
-
public_ip = self.system.network_client.public_ip_addresses.
|
|
428
|
+
public_ip = self.system.network_client.public_ip_addresses.begin_create_or_update(
|
|
421
429
|
resource_group_name=resource_group,
|
|
422
430
|
public_ip_address_name=vm_name,
|
|
423
431
|
parameters=public_ip_params,
|
|
@@ -430,7 +438,7 @@ class AzureBlobImage(Template):
|
|
|
430
438
|
"location": location,
|
|
431
439
|
"address_space": {"address_prefixes": [address_space]},
|
|
432
440
|
}
|
|
433
|
-
virtual_networks.
|
|
441
|
+
virtual_networks.begin_create_or_update(
|
|
434
442
|
resource_group_name=resource_group,
|
|
435
443
|
virtual_network_name=vnet_name,
|
|
436
444
|
parameters=vnet_params,
|
|
@@ -440,7 +448,7 @@ class AzureBlobImage(Template):
|
|
|
440
448
|
subnet_name = "default"
|
|
441
449
|
subnets = self.system.network_client.subnets
|
|
442
450
|
if subnet_name not in [v.name for v in subnets.list(resource_group, vnet_name)]:
|
|
443
|
-
vsubnet = subnets.
|
|
451
|
+
vsubnet = subnets.begin_create_or_update(
|
|
444
452
|
resource_group_name=resource_group,
|
|
445
453
|
virtual_network_name=vnet_name,
|
|
446
454
|
subnet_name="default",
|
|
@@ -466,7 +474,7 @@ class AzureBlobImage(Template):
|
|
|
466
474
|
}
|
|
467
475
|
|
|
468
476
|
def _create_or_update_nic():
|
|
469
|
-
return self.system.network_client.network_interfaces.
|
|
477
|
+
return self.system.network_client.network_interfaces.begin_create_or_update(
|
|
470
478
|
resource_group_name=resource_group,
|
|
471
479
|
network_interface_name=vm_name,
|
|
472
480
|
parameters=nic_params,
|
|
@@ -504,7 +512,7 @@ class AzureBlobImage(Template):
|
|
|
504
512
|
},
|
|
505
513
|
"network_profile": {"network_interfaces": [{"id": nic.id}]},
|
|
506
514
|
}
|
|
507
|
-
vm = self.system.compute_client.virtual_machines.
|
|
515
|
+
vm = self.system.compute_client.virtual_machines.begin_create_or_update(
|
|
508
516
|
resource_group_name=resource_group,
|
|
509
517
|
vm_name=vm_name,
|
|
510
518
|
parameters=vm_parameters,
|
|
@@ -888,7 +896,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
888
896
|
|
|
889
897
|
resources = self._list_resources(resource_group, hours_old)
|
|
890
898
|
if resources:
|
|
891
|
-
self.resource_client.resource_groups.
|
|
899
|
+
self.resource_client.resource_groups.begin_delete(resource_group)
|
|
892
900
|
|
|
893
901
|
def remove_nics_by_search(self, nic_template=None, resource_group=None):
|
|
894
902
|
"""
|
|
@@ -904,7 +912,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
904
912
|
|
|
905
913
|
for nic in nic_list:
|
|
906
914
|
try:
|
|
907
|
-
operation = self.network_client.network_interfaces.
|
|
915
|
+
operation = self.network_client.network_interfaces.begin_delete(
|
|
908
916
|
resource_group_name=resource_group or self.resource_group,
|
|
909
917
|
network_interface_name=nic,
|
|
910
918
|
)
|
|
@@ -932,7 +940,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
932
940
|
)
|
|
933
941
|
|
|
934
942
|
for pip in pip_list:
|
|
935
|
-
operation = self.network_client.public_ip_addresses.
|
|
943
|
+
operation = self.network_client.public_ip_addresses.begin_delete(
|
|
936
944
|
resource_group_name=resource_group or self.resource_group,
|
|
937
945
|
public_ip_address_name=pip,
|
|
938
946
|
)
|
|
@@ -965,7 +973,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
965
973
|
self.logger.info("Attempting to find all the unattached disks and delete.")
|
|
966
974
|
discs = self.list_free_discs(resource_group=self.resource_group)
|
|
967
975
|
for disc_name in discs:
|
|
968
|
-
operation = self.compute_client.disks.
|
|
976
|
+
operation = self.compute_client.disks.begin_delete(
|
|
969
977
|
resource_group_name=resource_group or self.resource_group,
|
|
970
978
|
disk_name=disc_name,
|
|
971
979
|
)
|
|
@@ -980,7 +988,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
980
988
|
security_groups = self.network_client.network_security_groups
|
|
981
989
|
self.logger.info("Attempting to Create New Azure Security Group %s", group_name)
|
|
982
990
|
nsg = NetworkSecurityGroup(location=self.region)
|
|
983
|
-
operation = security_groups.
|
|
991
|
+
operation = security_groups.begin_create_or_update(
|
|
984
992
|
resource_group_name=resource_group or self.resource_group,
|
|
985
993
|
network_security_group_name=group_name,
|
|
986
994
|
parameters=nsg,
|
|
@@ -997,7 +1005,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
997
1005
|
"""
|
|
998
1006
|
self.logger.info("Attempting to Remove Azure Security Group '%s'", group_name)
|
|
999
1007
|
security_groups = self.network_client.network_security_groups
|
|
1000
|
-
operation = security_groups.
|
|
1008
|
+
operation = security_groups.begin_delete(
|
|
1001
1009
|
resource_group_name=resource_group or self.resource_group,
|
|
1002
1010
|
network_security_group_name=group_name,
|
|
1003
1011
|
)
|
|
@@ -1031,7 +1039,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1031
1039
|
)
|
|
1032
1040
|
]
|
|
1033
1041
|
nsg = self.network_client.network_security_groups
|
|
1034
|
-
operation = nsg.
|
|
1042
|
+
operation = nsg.begin_create_or_update(resource_group, secgroup_name, parameters)
|
|
1035
1043
|
operation.wait()
|
|
1036
1044
|
self.logger.info("Network Security Group Rule is created.")
|
|
1037
1045
|
return operation.status()
|
|
@@ -1079,7 +1087,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1079
1087
|
dest_blob_client.start_copy_from_url(src_uri)
|
|
1080
1088
|
wait_for(
|
|
1081
1089
|
lambda: dest_blob_client.get_blob_properties().copy.status != "pending",
|
|
1082
|
-
timeout=
|
|
1090
|
+
timeout=10 * 60,
|
|
1083
1091
|
delay=15,
|
|
1084
1092
|
)
|
|
1085
1093
|
# copy operation obj.status->str
|
|
@@ -1135,7 +1143,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1135
1143
|
for disk in self.compute_client.disks.list_by_resource_group(resource_group):
|
|
1136
1144
|
if disk.name.startswith("test") and disk.managed_by is None:
|
|
1137
1145
|
self.logger.info("Removing disk '%s'", disk.name)
|
|
1138
|
-
self.compute_client.disks.
|
|
1146
|
+
self.compute_client.disks.begin_delete(
|
|
1139
1147
|
resource_group_name=resource_group, disk_name=disk.name
|
|
1140
1148
|
)
|
|
1141
1149
|
removed_disks.append({"resource_group": resource_group, "disk": disk.name})
|
|
@@ -1269,7 +1277,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1269
1277
|
"""
|
|
1270
1278
|
self.logger.info("Removes a Deployment Stack resource created with Orchestration")
|
|
1271
1279
|
deps = self.resource_client.deployments
|
|
1272
|
-
operation = deps.
|
|
1280
|
+
operation = deps.begin_delete(
|
|
1273
1281
|
resource_group_name=resource_group or self.resource_group,
|
|
1274
1282
|
deployment_name=stack_name,
|
|
1275
1283
|
)
|
|
@@ -1306,7 +1314,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1306
1314
|
resource_group = resource_group or self.resource_group
|
|
1307
1315
|
for image in image_list:
|
|
1308
1316
|
self.logger.info("Deleting '%s' from '%s'", image, resource_group)
|
|
1309
|
-
response = self.compute_client.images.
|
|
1317
|
+
response = self.compute_client.images.begin_delete(
|
|
1310
1318
|
resource_group_name=resource_group, image_name=image
|
|
1311
1319
|
)
|
|
1312
1320
|
result.append((image, response))
|
|
@@ -288,7 +288,7 @@ class OpenstackInstance(_SharedMethodsMixin, Instance):
|
|
|
288
288
|
self.system.openstack_conn.compute.remove_floating_ip_from_server(
|
|
289
289
|
instance, floating_ip.floating_ip_address
|
|
290
290
|
)
|
|
291
|
-
wait_for(lambda: self.ip is None, delay=1, timeout=
|
|
291
|
+
wait_for(lambda: self.ip is None, delay=1, timeout=60)
|
|
292
292
|
return floating_ip
|
|
293
293
|
|
|
294
294
|
def delete(self, delete_fip=False):
|
|
@@ -302,7 +302,7 @@ class OpenstackInstance(_SharedMethodsMixin, Instance):
|
|
|
302
302
|
|
|
303
303
|
self.logger.info(" Delete in progress instance %s", self.name)
|
|
304
304
|
self.raw.delete()
|
|
305
|
-
wait_for(lambda: not self.exists, timeout=
|
|
305
|
+
wait_for(lambda: not self.exists, timeout=3 * 60, delay=5)
|
|
306
306
|
return True
|
|
307
307
|
|
|
308
308
|
def cleanup(self):
|
|
@@ -386,9 +386,9 @@ class OpenstackInstance(_SharedMethodsMixin, Instance):
|
|
|
386
386
|
self.stop()
|
|
387
387
|
# set image name only if template_name passed, else take original VM name
|
|
388
388
|
uuid = self.raw.create_image(image_name if template_name else original_name)
|
|
389
|
-
wait_for(lambda: self._api.images.get(uuid).status == "ACTIVE",
|
|
389
|
+
wait_for(lambda: self._api.images.get(uuid).status == "ACTIVE", timeout=900, delay=5)
|
|
390
390
|
self.delete()
|
|
391
|
-
wait_for(lambda: not self.exists,
|
|
391
|
+
wait_for(lambda: not self.exists, timeout=180, delay=5)
|
|
392
392
|
except Exception:
|
|
393
393
|
self.logger.exception("Could not mark %s as a OpenStack template!", original_name)
|
|
394
394
|
try:
|
|
@@ -460,7 +460,7 @@ class OpenstackImage(_SharedMethodsMixin, Template):
|
|
|
460
460
|
|
|
461
461
|
def delete(self):
|
|
462
462
|
self.raw.delete()
|
|
463
|
-
wait_for(lambda: not self.exists,
|
|
463
|
+
wait_for(lambda: not self.exists, timeout=120, delay=10)
|
|
464
464
|
|
|
465
465
|
def cleanup(self):
|
|
466
466
|
return self.delete()
|
|
@@ -1040,7 +1040,7 @@ class OpenstackSystem(System, VmMixin, TemplateMixin):
|
|
|
1040
1040
|
|
|
1041
1041
|
def create_volume(self, size_gb, **kwargs):
|
|
1042
1042
|
volume = self.capi.volumes.create(size_gb, **kwargs).id
|
|
1043
|
-
wait_for(lambda: self.capi.volumes.get(volume).status == "available",
|
|
1043
|
+
wait_for(lambda: self.capi.volumes.get(volume).status == "available", timeout=60, delay=0.5)
|
|
1044
1044
|
return volume
|
|
1045
1045
|
|
|
1046
1046
|
def delete_volume(self, *ids, **kwargs):
|
|
@@ -1052,7 +1052,7 @@ class OpenstackSystem(System, VmMixin, TemplateMixin):
|
|
|
1052
1052
|
return
|
|
1053
1053
|
# Wait for them
|
|
1054
1054
|
wait_for(
|
|
1055
|
-
lambda: all([not self.volume_exists(id) for id in ids]), delay=0.5,
|
|
1055
|
+
lambda: all([not self.volume_exists(id) for id in ids]), delay=0.5, timeout=timeout
|
|
1056
1056
|
)
|
|
1057
1057
|
|
|
1058
1058
|
def volume_exists(self, id):
|
|
@@ -1173,7 +1173,7 @@ class OpenstackSystem(System, VmMixin, TemplateMixin):
|
|
|
1173
1173
|
wait_for(
|
|
1174
1174
|
lambda: len(self._list_floating_ips(ip=floating_ip.floating_ip_address)) == 0,
|
|
1175
1175
|
delay=1,
|
|
1176
|
-
timeout=
|
|
1176
|
+
timeout=60,
|
|
1177
1177
|
)
|
|
1178
1178
|
return True
|
|
1179
1179
|
|
|
@@ -239,7 +239,7 @@ class RHEVMVirtualMachine(_SharedMethodsMixin, Vm):
|
|
|
239
239
|
wait_for(
|
|
240
240
|
lambda: not self.exists,
|
|
241
241
|
message=f"wait for RHEV VM '{self.uuid}' deleted",
|
|
242
|
-
|
|
242
|
+
timeout=300,
|
|
243
243
|
)
|
|
244
244
|
return True
|
|
245
245
|
|
|
@@ -505,7 +505,7 @@ class RHEVMVirtualMachine(_SharedMethodsMixin, Vm):
|
|
|
505
505
|
self._is_disk_ok,
|
|
506
506
|
func_args=[disk_attachment.disk.id],
|
|
507
507
|
delay=5,
|
|
508
|
-
|
|
508
|
+
timeout=900,
|
|
509
509
|
message="check if disk is attached",
|
|
510
510
|
)
|
|
511
511
|
|
|
@@ -549,7 +549,7 @@ class RHEVMVirtualMachine(_SharedMethodsMixin, Vm):
|
|
|
549
549
|
self._is_disk_ok,
|
|
550
550
|
func_args=[disk_attachment.disk.id],
|
|
551
551
|
delay=5,
|
|
552
|
-
|
|
552
|
+
timeout=900,
|
|
553
553
|
message="check if disk is attached",
|
|
554
554
|
)
|
|
555
555
|
return True
|
|
@@ -564,7 +564,7 @@ class RHEVMVirtualMachine(_SharedMethodsMixin, Vm):
|
|
|
564
564
|
wait_for(
|
|
565
565
|
lambda: not self.is_disk_attached(disk_name),
|
|
566
566
|
delay=5,
|
|
567
|
-
|
|
567
|
+
timeout=900,
|
|
568
568
|
message="disk to no longer be attached",
|
|
569
569
|
)
|
|
570
570
|
return True
|
|
@@ -600,7 +600,7 @@ class RHEVMTemplate(_SharedMethodsMixin, Template):
|
|
|
600
600
|
self.logger.debug(" Deleting RHEV template %s/%s", self.name, self.uuid)
|
|
601
601
|
self.wait_for_ok_status()
|
|
602
602
|
self.api.remove()
|
|
603
|
-
wait_for(lambda: not self.exists,
|
|
603
|
+
wait_for(lambda: not self.exists, timeout=timeout, delay=5)
|
|
604
604
|
|
|
605
605
|
def cleanup(self):
|
|
606
606
|
"""
|
|
@@ -627,7 +627,7 @@ class RHEVMTemplate(_SharedMethodsMixin, Template):
|
|
|
627
627
|
def wait_for_ok_status(self, timeout=1800):
|
|
628
628
|
wait_for(
|
|
629
629
|
lambda: self.api.get().status == types.TemplateStatus.OK,
|
|
630
|
-
|
|
630
|
+
timeout=timeout,
|
|
631
631
|
message="template is OK",
|
|
632
632
|
delay=10,
|
|
633
633
|
)
|
|
@@ -1047,7 +1047,7 @@ class RHEVMSystem(System, VmMixin, TemplateMixin):
|
|
|
1047
1047
|
wait_for(
|
|
1048
1048
|
func=self.does_template_exist,
|
|
1049
1049
|
func_args=[template_name],
|
|
1050
|
-
|
|
1050
|
+
timeout=timeout,
|
|
1051
1051
|
message="template exists",
|
|
1052
1052
|
delay=5,
|
|
1053
1053
|
)
|
|
@@ -1139,7 +1139,7 @@ class RHEVMSystem(System, VmMixin, TemplateMixin):
|
|
|
1139
1139
|
properties=properties,
|
|
1140
1140
|
)
|
|
1141
1141
|
)
|
|
1142
|
-
wait_for(self.does_glance_server_exist, func_args=[name], delay=5,
|
|
1142
|
+
wait_for(self.does_glance_server_exist, func_args=[name], delay=5, timeout=240)
|
|
1143
1143
|
|
|
1144
1144
|
@property
|
|
1145
1145
|
def _storage_domains_service(self):
|
|
@@ -1183,7 +1183,7 @@ class RHEVMSystem(System, VmMixin, TemplateMixin):
|
|
|
1183
1183
|
cluster=types.Cluster(name=target_cluster_name),
|
|
1184
1184
|
storage_domain=types.StorageDomain(name=target_storage_domain_name),
|
|
1185
1185
|
)
|
|
1186
|
-
wait_for(self.does_template_exist, func_args=[target_template_name], delay=5,
|
|
1186
|
+
wait_for(self.does_template_exist, func_args=[target_template_name], delay=5, timeout=240)
|
|
1187
1187
|
|
|
1188
1188
|
def _get_disk_service(self, disk_name):
|
|
1189
1189
|
disks_service = self.api.system_service().disks_service()
|
|
@@ -1262,7 +1262,7 @@ class RHEVMSystem(System, VmMixin, TemplateMixin):
|
|
|
1262
1262
|
wait_for(
|
|
1263
1263
|
lambda: self.api.follow_link(domain).status == expected_state,
|
|
1264
1264
|
delay=5,
|
|
1265
|
-
|
|
1265
|
+
timeout=timeout,
|
|
1266
1266
|
message="waiting for {} to reach state {}".format(
|
|
1267
1267
|
storage_domain_name, expected_state
|
|
1268
1268
|
),
|
|
@@ -292,7 +292,7 @@ class SCVirtualMachine(Vm, _LogStrMixin):
|
|
|
292
292
|
wait_for(
|
|
293
293
|
lambda: not self.exists,
|
|
294
294
|
delay=5,
|
|
295
|
-
timeout=
|
|
295
|
+
timeout=3 * 60,
|
|
296
296
|
message=f"vm {self._log_str} to not exist",
|
|
297
297
|
)
|
|
298
298
|
return True
|
|
@@ -308,7 +308,7 @@ class SCVirtualMachine(Vm, _LogStrMixin):
|
|
|
308
308
|
wait_for(
|
|
309
309
|
lambda: self.refresh(read_from_hyperv=True) and self.name != old_name,
|
|
310
310
|
delay=5,
|
|
311
|
-
timeout=
|
|
311
|
+
timeout=3 * 60,
|
|
312
312
|
message=f"vm {self._log_str} to change names",
|
|
313
313
|
)
|
|
314
314
|
return True
|
|
@@ -195,7 +195,9 @@ class VMWareVMOrTemplate(Entity):
|
|
|
195
195
|
task = self.raw.Destroy_Task()
|
|
196
196
|
|
|
197
197
|
try:
|
|
198
|
-
wait_for(
|
|
198
|
+
wait_for(
|
|
199
|
+
lambda: self.system.get_task_status(task) == "success", delay=3, timeout=4 * 60
|
|
200
|
+
)
|
|
199
201
|
except TimedOutError:
|
|
200
202
|
self.logger.warn("Hit TimedOutError waiting for VM '%s' delete task", self.name)
|
|
201
203
|
if self.exists:
|
|
@@ -597,7 +599,7 @@ class VMWareVMOrTemplate(Entity):
|
|
|
597
599
|
store[0] = self.system.get_updated_obj(store[0])
|
|
598
600
|
return False
|
|
599
601
|
|
|
600
|
-
wait_for(_check,
|
|
602
|
+
wait_for(_check, timeout=provision_timeout, delay=4)
|
|
601
603
|
|
|
602
604
|
if task.info.state != "success":
|
|
603
605
|
self.logger.error(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|