nsupdate: Don't try fixing non-existing TXT values (#63408)

The commit 4e895c1 aimed to ensure that TXT record values were sanely
quoted. Sadly it failed to take the scenario of non-existing values
into account. While record values are required for record creation
they are not required for record deletion.

This change rectifies that oversight, saving Ansible from
unsuccessfully trying to operate on NoneType objects.

Resolves #63364
pull/63559/merge
Andreas Olsson 5 years ago committed by Abhijeet Kasurde
parent 332b220854
commit 98b025239a

@ -0,0 +1,2 @@
bugfixes:
- nsupdate - Do not try fixing non-existing TXT values (https://github.com/ansible/ansible/issues/63364)

@ -232,7 +232,7 @@ class RecordManager(object):
else:
self.algorithm = module.params['key_algorithm']
if self.module.params['type'].lower() == 'txt':
if self.module.params['type'].lower() == 'txt' and self.module.params['value'] is not None:
self.value = list(map(self.txt_helper, self.module.params['value']))
else:
self.value = self.module.params['value']

Loading…
Cancel
Save