AWS: check dbname attribute before accessing (#46253)
Check dbname attribute in instance before accessing it in RDS module Fixes: #38210 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
a4c9f57b38
commit
e5878d19de
1 changed files with 2 additions and 4 deletions
|
@ -716,8 +716,7 @@ class RDSDBInstance:
|
|||
d["endpoint"] = None
|
||||
d["port"] = None
|
||||
d["vpc_security_groups"] = None
|
||||
if self.instance.DBName:
|
||||
d['DBName'] = self.instance.DBName
|
||||
d['DBName'] = self.instance.DBName if hasattr(self.instance, 'DBName') else None
|
||||
# ReadReplicaSourceDBInstanceIdentifier may or may not exist
|
||||
try:
|
||||
d["replication_source"] = self.instance.ReadReplicaSourceDBInstanceIdentifier
|
||||
|
@ -810,8 +809,7 @@ class RDS2DBInstance:
|
|||
else:
|
||||
d['endpoint'] = None
|
||||
d['port'] = None
|
||||
if self.instance["DBName"]:
|
||||
d['DBName'] = self.instance['DBName']
|
||||
d['DBName'] = self.instance['DBName'] if hasattr(self.instance, 'DBName') else None
|
||||
return d
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue