Adds params to the profile-client-ssl module (#44656)

This patch adds new parameters to the client ssl module.
This commit is contained in:
Tim Rupp 2018-08-24 15:51:24 -04:00 committed by GitHub
commit 79153b95e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 231 additions and 15 deletions

View file

@ -63,9 +63,7 @@ class F5Client(F5BaseClient):
class F5RestClient(F5BaseClient):
def __init__(self, *args, **kwargs):
params = kwargs.get('module').params
module = kwargs.pop('module')
super(F5RestClient, self).__init__(module=module, **params)
super(F5RestClient, self).__init__(*args, **kwargs)
self.provider = self.merge_provider_params()
@property
@ -89,7 +87,7 @@ class F5RestClient(F5BaseClient):
if response.status not in [200]:
raise F5ModuleError('Status code: {0}. Unexpected Error: {1} for uri: {2}\nText: {3}'.format(
response.status, response.reason, response.url, response._content
response.status, response.reason, response.url, response.content
))
session.headers['X-F5-Auth-Token'] = response.json()['token']['token']

View file

@ -54,6 +54,7 @@ f5_provider_spec = {
default='rest'
),
'timeout': dict(type='int'),
'auth_provider': dict()
}
f5_argument_spec = {
@ -88,6 +89,9 @@ f5_top_spec = {
'transport': dict(
removed_in_version=2.9,
choices=['cli', 'rest']
),
'auth_provider': dict(
default=None
)
}
f5_argument_spec.update(f5_top_spec)
@ -105,6 +109,13 @@ def load_params(params):
params[key] = value
def is_empty_list(seq):
if len(seq) == 1:
if seq[0] == '' or seq[0] == 'none':
return True
return False
# Fully Qualified name (with the partition)
def fqdn_name(partition, value):
"""This method is not used
@ -204,7 +215,9 @@ def flatten_boolean(value):
return 'no'
def cleanup_tokens(client):
def cleanup_tokens(client=None):
if client is None:
return
try:
# isinstance cannot be used here because to import it creates a
# circular dependency with teh module_utils.network.f5.bigip file.