Merge "Fix waiters to raise on resources going to ERROR"
diff --git a/designate_tempest_plugin/common/exceptions.py b/designate_tempest_plugin/common/exceptions.py
index d3f343d..27bf848 100644
--- a/designate_tempest_plugin/common/exceptions.py
+++ b/designate_tempest_plugin/common/exceptions.py
@@ -15,7 +15,7 @@
class InvalidStatusError(Exception):
"""
- Exception raise when an entity changes to an unexpected status.
+ Exception raised when an entity changes to an unexpected status.
"""
def __init__(self, entity, entity_id, status, expected_status=None):
diff --git a/designate_tempest_plugin/common/waiters.py b/designate_tempest_plugin/common/waiters.py
index 6bc5dfa..a606fda 100644
--- a/designate_tempest_plugin/common/waiters.py
+++ b/designate_tempest_plugin/common/waiters.py
@@ -73,6 +73,10 @@
LOG.info('Zone %s reached %s', zone_id, status)
return
+ if zone['status'] == const.ERROR:
+ raise exceptions.InvalidStatusError('Zone', zone_id,
+ zone['status'])
+
if int(time.time()) - start >= client.build_timeout:
message = ('Zone %(zone_id)s failed to reach status=%(status)s '
'within the required time (%(timeout)s s). Current '
@@ -105,6 +109,10 @@
LOG.info('Zone import %s reached %s', zone_import_id, status)
return
+ if zone_import['status'] == const.ERROR:
+ raise exceptions.InvalidStatusError('Zone Import', zone_import_id,
+ zone_import['status'])
+
if int(time.time()) - start >= client.build_timeout:
message = ('Zone import %(zone_import_id)s failed to reach '
'status=%(status)s within the required time '
@@ -138,6 +146,10 @@
LOG.info('Zone export %s reached %s', zone_export_id, status)
return
+ if zone_export['status'] == const.ERROR:
+ raise exceptions.InvalidStatusError('Zone Export', zone_export_id,
+ zone_export['status'])
+
if int(time.time()) - start >= client.build_timeout:
message = ('Zone export %(zone_export_id)s failed to reach '
'status=%(status)s within the required time '
@@ -172,6 +184,10 @@
LOG.info('Recordset %s reached %s', recordset_id, status)
return
+ if recordset['status'] == const.ERROR:
+ raise exceptions.InvalidStatusError('Recordset', recordset_id,
+ recordset['status'])
+
if int(time.time()) - start >= client.build_timeout:
message = ('Recordset %(recordset_id)s failed to reach '
'status=%(status)s within the required time '
@@ -250,6 +266,10 @@
LOG.info('PTR %s reached %s', fip_id, status)
return
+ if ptr['status'] == const.ERROR:
+ raise exceptions.InvalidStatusError('PTR', fip_id,
+ ptr['status'])
+
if int(time.time()) - start >= client.build_timeout:
message = ('PTR for FIP: %(fip_id)s failed to reach '
'status=%(status)s within the required time '