Merge "Introduce error.capacity states_key for InsufficientInstanceCapacity error"
This commit is contained in:
commit
7abd12906f
@ -1120,6 +1120,12 @@ class AwsAdapter(statemachine.Adapter):
|
||||
# Re-raise as a quota exception so that the
|
||||
# statemachine driver resets quota.
|
||||
raise exceptions.QuotaException(str(error))
|
||||
if (error.response['Error']['Code'] ==
|
||||
'InsufficientInstanceCapacity'):
|
||||
# Re-raise as CapacityException so it would have
|
||||
# "error.capacity" statsd_key, which can be handled
|
||||
# differently than "error.unknown"
|
||||
raise exceptions.CapacityException(str(error))
|
||||
raise
|
||||
|
||||
def _createInstance(self, label, image_external_id,
|
||||
|
@ -31,6 +31,10 @@ class LaunchKeyscanException(Exception):
|
||||
statsd_key = 'error.keyscan'
|
||||
|
||||
|
||||
class CapacityException(Exception):
|
||||
statsd_key = 'error.capacity'
|
||||
|
||||
|
||||
class BuilderError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user