add debug
This commit is contained in:
parent
00288f10b3
commit
cea2b74442
1 changed files with 11 additions and 2 deletions
|
@ -101,12 +101,21 @@ class OvhDnsEnsure:
|
|||
self.records = self.ovh.get(f"/domain/zone/{self.config['zone']}/record", **params)
|
||||
self.current_state = 'absent'
|
||||
for record in self.records:
|
||||
self._log.debug(
|
||||
"Checking record: %s...",
|
||||
record
|
||||
)
|
||||
data = self.ovh.get(f"/domain/zone/{self.config['zone']}/record/{record}")
|
||||
if data['target'] == self.config['target'] and data['ttl'] == self.config['ttl']:
|
||||
self.current_state = 'same'
|
||||
self._log.debug('A record with the same type, TTL and target exists. %s', data)
|
||||
self._log.debug(
|
||||
'A record with the same type, TTL and target exists. %s',
|
||||
data
|
||||
)
|
||||
if self.current_state == 'absent' and len(self.records) == 0:
|
||||
self._log.debug("Doesn't exist a record with that type and target")
|
||||
self._log.debug(
|
||||
"Doesn't exist a record with that type and target"
|
||||
)
|
||||
elif self.current_state == 'absent' and len(self.records) > 0:
|
||||
self._log.debug(
|
||||
"There are %s records with same type but different target or TTL",
|
||||
|
|
Loading…
Reference in a new issue