mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Added check for avi SDK version as suggested in review. (#21927)
* Added check for avi SDK version as suggested in review. * Fixed documentation based on review. * Renamed module_utils.avi to module_utils.avi_ansible_utils as import of avi.sdk would fail due to name collisions. Moved the code to check for AVI version into the ansible modules. * Updated the module with note about reason for name change.
This commit is contained in:
parent
2f2e792cae
commit
6df5f89763
7 changed files with 37 additions and 28 deletions
|
@ -128,12 +128,10 @@ obj:
|
|||
'''
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.avi import avi_common_argument_spec
|
||||
|
||||
|
||||
HAS_AVI = True
|
||||
try:
|
||||
from avi.sdk.utils.ansible_utils import avi_ansible_api
|
||||
from ansible.module_utils.avi_ansible_utils import (
|
||||
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
|
||||
except ImportError:
|
||||
HAS_AVI = False
|
||||
|
||||
|
@ -164,7 +162,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) is not installed. '
|
||||
'Avi python API SDK (avisdk>=16.3.5.post1) is not installed. '
|
||||
'For more details visit https://github.com/avinetworks/sdk.'))
|
||||
return avi_ansible_api(module, 'sslkeyandcertificate',
|
||||
set(['key']))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue