mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Add ANSIBLE_VERSION to module_utils/basic.py and manipulate the pyrax user-agent
This commit is contained in:
parent
585fd5a138
commit
88acb48753
3 changed files with 29 additions and 18 deletions
|
@ -25,11 +25,14 @@ import shlex
|
|||
from ansible import errors
|
||||
from ansible import utils
|
||||
from ansible import constants as C
|
||||
from ansible import __version__
|
||||
|
||||
REPLACER = "#<<INCLUDE_ANSIBLE_MODULE_COMMON>>"
|
||||
REPLACER_ARGS = "\"<<INCLUDE_ANSIBLE_MODULE_ARGS>>\""
|
||||
REPLACER_COMPLEX = "\"<<INCLUDE_ANSIBLE_MODULE_COMPLEX_ARGS>>\""
|
||||
REPLACER_WINDOWS = "# POWERSHELL_COMMON"
|
||||
REPLACER_VERSION = "\"<<ANSIBLE_VERSION>>\""
|
||||
|
||||
|
||||
class ModuleReplacer(object):
|
||||
|
||||
|
@ -156,6 +159,7 @@ class ModuleReplacer(object):
|
|||
encoded_complex = repr(complex_args_json)
|
||||
|
||||
# these strings should be part of the 'basic' snippet which is required to be included
|
||||
module_data = module_data.replace(REPLACER_VERSION, repr(__version__))
|
||||
module_data = module_data.replace(REPLACER_ARGS, encoded_args)
|
||||
module_data = module_data.replace(REPLACER_COMPLEX, encoded_complex)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue