Fixes and additions for f5 modules (#39986)

Small fixes in the f5 module utils. I believe the action plugins now
work consistently across types of connections
This commit is contained in:
Tim Rupp 2018-05-11 11:45:42 -07:00 committed by GitHub
commit 00a6b19e58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 172 additions and 162 deletions

View file

@ -295,8 +295,6 @@ def compare_dictionary(want, have):
Returns:
bool:
:param have:
:return:
"""
if want == [] and have is None:
return None
@ -328,6 +326,26 @@ def exit_json(module, results, client=None):
module.exit_json(**results)
def is_uuid(uuid=None):
"""Check to see if value is an F5 UUID
UUIDs are used in BIG-IQ and in select areas of BIG-IP (notably ASM). This method
will check to see if the provided value matches a UUID as known by these products.
Args:
uuid (string): The value to check for UUID-ness
Returns:
bool:
"""
if uuid is None:
return False
pattern = r'[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}'
if re.match(pattern, uuid):
return True
return False
class Noop(object):
"""Represent no-operation required
@ -405,7 +423,7 @@ class F5BaseClient(object):
elif self.params.get('auth_provider', None):
result['auth_provider'] = self.params.get('auth_provider', None)
else:
result['auth_provider'] = 'tmos'
result['auth_provider'] = None
if provider.get('user', None):
result['user'] = provider.get('user', None)