mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
azure: fix creation of TXT dns record sets (#38368)
As per `azure.mgmt.dns.models.txt_record.TxtRecord`, expected value for a record is of type `[str]`. Fix TXT argspec to specify type as `list` instead of `str`. Fixes #37581 Reference: https://docs.microsoft.com/en-us/python/api/azure.mgmt.dns.models.txtrecord?view=azure-python
This commit is contained in:
parent
8c27ffdf90
commit
eb430b2e57
2 changed files with 26 additions and 2 deletions
|
@ -211,7 +211,7 @@ RECORD_ARGSPECS = dict(
|
|||
target=dict(type='str', required=True, aliases=['entry'])
|
||||
),
|
||||
TXT=dict(
|
||||
value=dict(type='str', required=True, aliases=['entry'])
|
||||
value=dict(type='list', required=True, aliases=['entry'])
|
||||
),
|
||||
# FUTURE: ensure all record types are supported (see https://github.com/Azure/azure-sdk-for-python/tree/master/azure-mgmt-dns/azure/mgmt/dns/models)
|
||||
)
|
||||
|
@ -375,7 +375,11 @@ class AzureRMRecordSet(AzureRMModuleBase):
|
|||
def gethash(self):
|
||||
if not getattr(self, '_cachedhash', None):
|
||||
spec = inspect.getargspec(self.__init__)
|
||||
valuetuple = tuple([getattr(self, x, None) for x in spec.args if x != 'self'])
|
||||
valuetuple = tuple(
|
||||
map(lambda v: v if not isinstance(v, list) else str(v), [
|
||||
getattr(self, x, None) for x in spec.args if x != 'self'
|
||||
])
|
||||
)
|
||||
self._cachedhash = hash(valuetuple)
|
||||
return self._cachedhash
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue