mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Fix 'macro name' timeout (#44001)
* Fix 'macro name' timeout Added function to send macro to device using 'sendonly'. * Filter 'macro' from normal commands * Removed white space * Undefined variable 'cmd'
This commit is contained in:
parent
d89a1be011
commit
a767929456
2 changed files with 34 additions and 1 deletions
|
@ -321,6 +321,13 @@ def check_args(module, warnings):
|
|||
'single character')
|
||||
|
||||
|
||||
def edit_config_or_macro(connection, commands):
|
||||
if "macro name" in commands[0]:
|
||||
connection.edit_macro(candidate=commands)
|
||||
else:
|
||||
connection.edit_config(candidate=commands)
|
||||
|
||||
|
||||
def get_candidate_config(module):
|
||||
candidate = ''
|
||||
if module.params['src']:
|
||||
|
@ -457,7 +464,7 @@ def main():
|
|||
# them with the current running config
|
||||
if not module.check_mode:
|
||||
if commands:
|
||||
connection.edit_config(candidate=commands)
|
||||
edit_config_or_macro(connection, commands)
|
||||
if banner_diff:
|
||||
connection.edit_banner(candidate=json.dumps(banner_diff), multiline_delimiter=module.params['multiline_delimiter'])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue