modify_db_instance should be able to rename DB instances (#1367)
This commit is contained in:
parent
9e1a233549
commit
796fa6647b
4 changed files with 32 additions and 0 deletions
|
|
@ -736,6 +736,10 @@ class RDS2Backend(BaseBackend):
|
|||
|
||||
def modify_database(self, db_instance_identifier, db_kwargs):
|
||||
database = self.describe_databases(db_instance_identifier)[0]
|
||||
if 'new_db_instance_identifier' in db_kwargs:
|
||||
del self.databases[db_instance_identifier]
|
||||
db_instance_identifier = db_kwargs['db_instance_identifier'] = db_kwargs.pop('new_db_instance_identifier')
|
||||
self.databases[db_instance_identifier] = database
|
||||
database.update(db_kwargs)
|
||||
return database
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@ class RDS2Response(BaseResponse):
|
|||
def modify_db_instance(self):
|
||||
db_instance_identifier = self._get_param('DBInstanceIdentifier')
|
||||
db_kwargs = self._get_db_kwargs()
|
||||
new_db_instance_identifier = self._get_param('NewDBInstanceIdentifier')
|
||||
if new_db_instance_identifier:
|
||||
db_kwargs['new_db_instance_identifier'] = new_db_instance_identifier
|
||||
database = self.backend.modify_database(
|
||||
db_instance_identifier, db_kwargs)
|
||||
template = self.response_template(MODIFY_DATABASE_TEMPLATE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue