From 4d77aef7e5d530e47eba836d7c94805e7fd13893 Mon Sep 17 00:00:00 2001 From: captainkerk Date: Sun, 28 Jan 2018 23:08:03 +0000 Subject: [PATCH] adjust spacing, remove unnecessary region_name variable from SnapshotCopyGrant init --- moto/redshift/models.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/moto/redshift/models.py b/moto/redshift/models.py index fd7c8b759..5da68fe67 100644 --- a/moto/redshift/models.py +++ b/moto/redshift/models.py @@ -237,10 +237,9 @@ class SnapshotCopyGrant(TaggableResourceMixin, BaseModel): resource_type = 'snapshotcopygrant' - def __init__(self, snapshot_copy_grant_name, kms_key_id, region_name): + def __init__(self, snapshot_copy_grant_name, kms_key_id): self.snapshot_copy_grant_name = snapshot_copy_grant_name self.kms_key_id = kms_key_id - self.region_name = region_name def to_json(self): return { @@ -590,20 +589,16 @@ class RedshiftBackend(BaseBackend): def create_snapshot_copy_grant(self, **kwargs): snapshot_copy_grant_name = kwargs['snapshot_copy_grant_name'] kms_key_id = kwargs['kms_key_id'] - region_name = kwargs['region_name'] if snapshot_copy_grant_name not in self.snapshot_copy_grants: - snapshot_copy_grant = SnapshotCopyGrant(snapshot_copy_grant_name, - kms_key_id, region_name) + snapshot_copy_grant = SnapshotCopyGrant(snapshot_copy_grant_name, kms_key_id) self.snapshot_copy_grants[snapshot_copy_grant_name] = snapshot_copy_grant return snapshot_copy_grant - raise SnapshotCopyGrantAlreadyExistsFaultError(snapshot_copy_grant_name) def delete_snapshot_copy_grant(self, **kwargs): snapshot_copy_grant_name = kwargs['snapshot_copy_grant_name'] if snapshot_copy_grant_name in self.snapshot_copy_grants: return self.snapshot_copy_grants.pop(snapshot_copy_grant_name) - raise SnapshotCopyGrantNotFoundFaultError(snapshot_copy_grant_name) def describe_snapshot_copy_grants(self, **kwargs):