From c3c6eaf2814677c05e826f2b4d2453fb35f53464 Mon Sep 17 00:00:00 2001 From: David Wilcox Date: Thu, 24 Nov 2016 13:07:26 +1100 Subject: [PATCH] rename duplicate rds/models db_instance_identifier to physical_resource_id (#776) * rename duplicate db_instance_identifier to physical_resource_id * Update create_from_cloudformation_json to use db_source_identifier str * Update code to be more conventional. --- moto/rds/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moto/rds/models.py b/moto/rds/models.py index 289ec9906..3ce005e5e 100644 --- a/moto/rds/models.py +++ b/moto/rds/models.py @@ -37,7 +37,6 @@ class Database(object): self.source_db_identifier = kwargs.get("source_db_identifier") self.db_instance_class = kwargs.get('db_instance_class') self.port = kwargs.get('port') - self.db_instance_identifier = kwargs.get('db_instance_identifier') self.db_name = kwargs.get("db_name") self.publicly_accessible = kwargs.get("publicly_accessible") if self.publicly_accessible is None: @@ -65,6 +64,10 @@ class Database(object): # DBParameterGroupName # VpcSecurityGroupIds.member.N + @property + def physical_resource_id(self): + return self.db_instance_identifier + @property def address(self): return "{0}.aaaaaaaaaa.{1}.rds.amazonaws.com".format(self.db_instance_identifier, self.region) @@ -130,7 +133,7 @@ class Database(object): source_db_identifier = properties.get("SourceDBInstanceIdentifier") if source_db_identifier: # Replica - db_kwargs["source_db_identifier"] = source_db_identifier.db_instance_identifier + db_kwargs["source_db_identifier"] = source_db_identifier database = rds_backend.create_database_replica(db_kwargs) else: database = rds_backend.create_database(db_kwargs)