You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case aoscx_config is supplied a config file with the src param, the playbook execution continues even if the source config file has invalid configuration in it.
I would have expected a module failure in case of invalid config, but this is not happening.
The text was updated successfully, but these errors were encountered:
It would be possible to return from load_config the stdout/stderr of every command invocation (out and err) and then:
if any of out (or err) contains the string ^Invalid input: (which is returned by the CLI in case of config command error) return an error instead of success - or, at least, return all the stdout/stderr to the user as a module output, and let the user decide what to do.
Option (b):
Directly edit the load_config to trigger an error (returing also the content of out - which will be useful to understand the broken command) in case it contains ^Invalid input: for a command.
Example (not tested nor validated):
try:
out = exec_command(module, command)
except ConnectionError as exc:
module.fail_json(
msg="unable to enter configuration mode",
err=to_text(exc, errors="surrogate_then_replace"),
)
if out.startswith("Invalid input:"):
module.fail_json(
msg="unable to send command",
err=to_text(out, errors="surrogate_then_replace"),
)
In case
aoscx_config
is supplied a config file with thesrc
param, the playbook execution continues even if the source config file has invalid configuration in it.I would have expected a module failure in case of invalid config, but this is not happening.
The text was updated successfully, but these errors were encountered: