From 6c3c6623bfb666300dc998e51165667c236c140c Mon Sep 17 00:00:00 2001 From: rocky4570fft Date: Sun, 13 Aug 2017 12:02:49 +1000 Subject: [PATCH] should only call create_snapshot if db_snapshot_identifier is filled --- moto/rds2/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moto/rds2/models.py b/moto/rds2/models.py index d9c1483ca..edb46a157 100644 --- a/moto/rds2/models.py +++ b/moto/rds2/models.py @@ -741,7 +741,8 @@ class RDS2Backend(BaseBackend): return RDSClientError('InvalidDBClusterStateFault', 'Invalid DB type, when trying to perform StopDBInstance. See AWS RDS documentation on rds.stop_db_instance') if database.status != 'available': return RDSClientError('InvalidDBInstanceState', 'when calling the StopDBInstance operation: Instance %s is not in available state' % db_instance_identifier) - self.create_rds_snapshot(db_instance_identifier, db_snapshot_identifier) + if db_snapshot_identifier: + self.create_rds_snapshot(db_instance_identifier, db_snapshot_identifier) database.status = 'shutdown' return database