Updated utils to remove Avi SDK dependency and Avi 18.2.2 version update (#54894)

* Updated utils to remove Avi SDK dependency and Avi 18.2.2 version update

* Fixed the python 3.x errors failing for avi_disable_session_cache_as_fact not properly documented

* Updated version added fields for new parameters

* fixed pep8 errors

* made requests import optional

* removed setting requests to None

* Added try catch for the avi helper methods such that any import fails then module fail gracefully. This was needed to pass the requests library not found error

* removed deprecated modules. Also, trying another fix to deal with requests import error

* Fixed python3 errors

* fixed pep8, no-dict-iteritems and import test failures

* added version 2.8 for new field

* some more code cleanup and formatting

* updated the fail message and fixed plint errors

* added workaround for unicode pylint

* fixed the version added for new parameter app_learning_memory_percent and removed unicode_literals import

* Removed check of HAS_AVI for common argument spec

* Updated version added value from 2.8 to 2.9

* Version added value fixes of CI error
This commit is contained in:
Chaitanya Deshpande 2019-05-17 22:42:06 +05:30 committed by Nathaniel Case
parent 63e33f7e71
commit b5935486da
72 changed files with 2906 additions and 980 deletions

View file

@ -69,6 +69,12 @@ options:
description:
- Uuid of pools that could be referred by vsdatascriptset objects.
- It is a reference to an object of type pool.
protocol_parser_refs:
description:
- List of protocol parsers that could be referred by vsdatascriptset objects.
- It is a reference to an object of type protocolparser.
- Field introduced in 18.2.3.
version_added: "2.9"
string_group_refs:
description:
- Uuid of string groups that could be referred by vsdatascriptset objects.
@ -106,7 +112,7 @@ obj:
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.network.avi.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
avi_common_argument_spec, avi_ansible_api, HAS_AVI)
except ImportError:
HAS_AVI = False
@ -125,6 +131,7 @@ def main():
name=dict(type='str', required=True),
pool_group_refs=dict(type='list',),
pool_refs=dict(type='list',),
protocol_parser_refs=dict(type='list',),
string_group_refs=dict(type='list',),
tenant_ref=dict(type='str',),
url=dict(type='str',),
@ -135,7 +142,7 @@ def main():
argument_spec=argument_specs, supports_check_mode=True)
if not HAS_AVI:
return module.fail_json(msg=(
'Avi python API SDK (avisdk>=17.1) is not installed. '
'Avi python API SDK (avisdk>=17.1) or requests is not installed. '
'For more details visit https://github.com/avinetworks/sdk.'))
return avi_ansible_api(module, 'vsdatascriptset',
set([]))