Various fixes for f5 modules (#44734)

A number of bugfixes for the remaining 2.7 work on the F5 modules.
This commit is contained in:
Tim Rupp 2018-08-27 14:09:03 -07:00 committed by GitHub
commit 0dacc606b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 560 additions and 199 deletions

View file

@ -372,6 +372,26 @@ class Parameters(AnsibleF5Parameters):
# This seems to happen only on 12.0.0
elif tmp['value'] == 'none':
tmp['value'] = ''
elif tmp['value'] == 'True':
tmp['value'] = 'yes'
elif tmp['value'] == 'False':
tmp['value'] = 'no'
elif isinstance(tmp['value'], bool):
if tmp['value'] is True:
tmp['value'] = 'yes'
else:
tmp['value'] = 'no'
if tmp['encrypted'] == 'True':
tmp['encrypted'] = 'yes'
elif tmp['encrypted'] == 'False':
tmp['encrypted'] = 'no'
elif isinstance(tmp['encrypted'], bool):
if tmp['encrypted'] is True:
tmp['encrypted'] = 'yes'
else:
tmp['encrypted'] = 'no'
result.append(tmp)
result = sorted(result, key=lambda k: k['name'])
return result
@ -390,6 +410,17 @@ class Parameters(AnsibleF5Parameters):
# BIG-IP removes empty values entries, so mimic this behavior
# for user-supplied values.
tmp['value'] = [str(x) for x in list['value']]
if tmp['encrypted'] == 'True':
tmp['encrypted'] = 'yes'
elif tmp['encrypted'] == 'False':
tmp['encrypted'] = 'no'
elif isinstance(tmp['encrypted'], bool):
if tmp['encrypted'] is True:
tmp['encrypted'] = 'yes'
else:
tmp['encrypted'] = 'no'
result.append(tmp)
result = sorted(result, key=lambda k: k['name'])
return result