Add check for UnknownSnapshotCopyRegionFault error
This commit is contained in:
parent
b4d7d183ab
commit
cf7869d0e2
3 changed files with 21 additions and 0 deletions
|
|
@ -150,3 +150,10 @@ class InvalidParameterCombinationError(RedshiftClientError):
|
|||
super(InvalidParameterCombinationError, self).__init__(
|
||||
"InvalidParameterCombination", message
|
||||
)
|
||||
|
||||
|
||||
class UnknownSnapshotCopyRegionFaultError(RedshiftClientError):
|
||||
def __init__(self, message):
|
||||
super(UnknownSnapshotCopyRegionFaultError, self).__init__(
|
||||
"UnknownSnapshotCopyRegionFault", message
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from .exceptions import (
|
|||
SnapshotCopyDisabledFaultError,
|
||||
SnapshotCopyGrantAlreadyExistsFaultError,
|
||||
SnapshotCopyGrantNotFoundFaultError,
|
||||
UnknownSnapshotCopyRegionFaultError,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -577,6 +578,10 @@ class RedshiftBackend(BaseBackend):
|
|||
raise InvalidParameterValueError(
|
||||
"SnapshotCopyGrantName is required for Snapshot Copy on KMS encrypted clusters."
|
||||
)
|
||||
if kwargs["destination_region"] == self.region:
|
||||
raise UnknownSnapshotCopyRegionFaultError(
|
||||
"Invalid region {}".format(self.region)
|
||||
)
|
||||
status = {
|
||||
"DestinationRegion": kwargs["destination_region"],
|
||||
"RetentionPeriod": kwargs["retention_period"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue