[cloud] Add DBName to RDS Facts if it exists (#27121)

* + Add DBName in RDS Facts if it's not null

* - remove 2 offending lines for automatic tests

* Syntax change for shorter code and improved readability
This commit is contained in:
Radu Epure 2017-08-28 15:33:34 +03:00 committed by Ryan Brown
parent 5be37018a2
commit 54c295699e

View file

@ -780,7 +780,8 @@ class RDSDBInstance:
d["endpoint"] = None
d["port"] = None
d["vpc_security_groups"] = None
if self.instance.DBName:
d['DBName'] = self.instance.DBName
# ReadReplicaSourceDBInstanceIdentifier may or may not exist
try:
d["replication_source"] = self.instance.ReadReplicaSourceDBInstanceIdentifier
@ -873,7 +874,8 @@ class RDS2DBInstance:
else:
d['endpoint'] = None
d['port'] = None
if self.instance["DBName"]:
d['DBName'] = self.instance['DBName']
return d