mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Add ANSIBLE_VERSION to module_utils/basic.py and manipulate the pyrax user-agent
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user