Correctly build params dict in recordset

Change If8fda40780050d271c9d869d8959ef569644fd88 unintentionally broke
our integration tests. This patch fixes the code and tests to make
everything pass again.

Change-Id: Ief8d1f9e1eec13a2d435e96a0d70e31a2b4431f2
This commit is contained in:
Rafael Castillo
2022-05-31 17:57:43 -07:00
parent d65ea4d560
commit d6cdad2c42
2 changed files with 14 additions and 10 deletions

View File

@@ -184,6 +184,10 @@ class DnsRecordsetModule(OpenStackModule):
def _needs_update(self, params, recordset):
for k in ('description', 'records', 'ttl', 'type'):
if k not in params:
continue
if k not in recordset:
return True
if params[k] is not None and params[k] != recordset[k]:
return True
return False
@@ -204,10 +208,10 @@ class DnsRecordsetModule(OpenStackModule):
description = self.params['description']
ttl = self.params['ttl']
params = {
description: description,
records: records,
type: recordset_type.upper(),
ttl: ttl,
'description': description,
'records': records,
'type': recordset_type.upper(),
'ttl': ttl,
}
return {k: v for k, v in params.items() if v is not None}