[pre-commit.ci] pre-commit autoupdate (#290)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/add-trailing-comma: v2.5.1 → v3.0.0](https://github.com/asottile/add-trailing-comma/compare/v2.5.1...v3.0.0) - [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.9-for-vscode → v3.0.0](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.9-for-vscode...v3.0.0) - [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>pull/292/head^2
parent
9e38baf8f2
commit
1c31436512
|
@ -16,12 +16,12 @@ repos:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
- repo: https://github.com/asottile/add-trailing-comma
|
- repo: https://github.com/asottile/add-trailing-comma
|
||||||
rev: v2.5.1
|
rev: v3.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: add-trailing-comma
|
- id: add-trailing-comma
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
rev: "v3.0.0-alpha.9-for-vscode"
|
rev: "v3.0.0"
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
|
@ -36,6 +36,6 @@ repos:
|
||||||
args: ["--filter-files"]
|
args: ["--filter-files"]
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 23.3.0
|
rev: 23.7.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
|
@ -113,7 +113,7 @@ class ActionModule(ActionBase):
|
||||||
self._display.warning(msg)
|
self._display.warning(msg)
|
||||||
|
|
||||||
parserlib = "ansible_collections.{corg}.{cname}.plugins.sub_plugins.cli_parser.{plugin}_parser".format(
|
parserlib = "ansible_collections.{corg}.{cname}.plugins.sub_plugins.cli_parser.{plugin}_parser".format(
|
||||||
**cref
|
**cref,
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
parsercls = getattr(import_module(parserlib), self.PARSER_CLS_NAME)
|
parsercls = getattr(import_module(parserlib), self.PARSER_CLS_NAME)
|
||||||
|
@ -135,7 +135,7 @@ class ActionModule(ActionBase):
|
||||||
]:
|
]:
|
||||||
parserlib = (
|
parserlib = (
|
||||||
"ansible_collections.{corg}.{cname}.plugins.cli_parsers.{plugin}_parser".format(
|
"ansible_collections.{corg}.{cname}.plugins.cli_parsers.{plugin}_parser".format(
|
||||||
**cref
|
**cref,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
@ -281,7 +281,7 @@ class ActionModule(ActionBase):
|
||||||
DOCUMENTATION,
|
DOCUMENTATION,
|
||||||
"cli_parse module",
|
"cli_parse module",
|
||||||
schema_conditionals=ARGSPEC_CONDITIONALS,
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
**self._task.args
|
**self._task.args,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
return argspec_result
|
return argspec_result
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ActionModule(ActionBase):
|
||||||
cref.update(directory=directory)
|
cref.update(directory=directory)
|
||||||
parserlib = (
|
parserlib = (
|
||||||
"ansible_collections.{corg}.{cname}.plugins.sub_plugins.{directory}.{plugin}".format(
|
"ansible_collections.{corg}.{cname}.plugins.sub_plugins.{directory}.{plugin}".format(
|
||||||
**cref
|
**cref,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -58,7 +58,7 @@ class ActionModule(ActionBase):
|
||||||
DOCUMENTATION,
|
DOCUMENTATION,
|
||||||
"validate module",
|
"validate module",
|
||||||
schema_conditionals=ARGSPEC_CONDITIONALS,
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
**self._task.args
|
**self._task.args,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
return argspec_result
|
return argspec_result
|
||||||
|
|
|
@ -176,7 +176,10 @@ def param_list_compare(*args, **kwargs):
|
||||||
)
|
)
|
||||||
|
|
||||||
valid, argspec_result, updated_params = check_argspec(
|
valid, argspec_result, updated_params = check_argspec(
|
||||||
DOCUMENTATION, "param_list_compare filter", schema_conditionals=ARGSPEC_CONDITIONALS, **data
|
DOCUMENTATION,
|
||||||
|
"param_list_compare filter",
|
||||||
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
|
**data,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
raise AnsibleFilterError(
|
raise AnsibleFilterError(
|
||||||
|
|
|
@ -94,7 +94,10 @@ def validate(*args, **kwargs):
|
||||||
params.update({"engine": kwargs["engine"]})
|
params.update({"engine": kwargs["engine"]})
|
||||||
|
|
||||||
valid, argspec_result, updated_params = check_argspec(
|
valid, argspec_result, updated_params = check_argspec(
|
||||||
DOCUMENTATION, "validate filter", schema_conditionals=ARGSPEC_CONDITIONALS, **params
|
DOCUMENTATION,
|
||||||
|
"validate filter",
|
||||||
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
|
**params,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
raise AnsibleFilterError(
|
raise AnsibleFilterError(
|
||||||
|
|
|
@ -112,7 +112,7 @@ class LookupModule(LookupBase):
|
||||||
schema=schema[0],
|
schema=schema[0],
|
||||||
name="validate lookup",
|
name="validate lookup",
|
||||||
schema_conditionals=ARGSPEC_CONDITIONALS,
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
**params
|
**params,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
raise AnsibleLookupError(
|
raise AnsibleLookupError(
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ValidateBase(object):
|
||||||
cref = dict(zip(["corg", "cname", "plugin"], engine.split(".")))
|
cref = dict(zip(["corg", "cname", "plugin"], engine.split(".")))
|
||||||
validatorlib = (
|
validatorlib = (
|
||||||
"ansible_collections.{corg}.{cname}.plugins.sub_plugins.validate.{plugin}".format(
|
"ansible_collections.{corg}.{cname}.plugins.sub_plugins.validate.{plugin}".format(
|
||||||
**cref
|
**cref,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -123,7 +123,9 @@ class ValidateBase(object):
|
||||||
break
|
break
|
||||||
|
|
||||||
valid, argspec_result, updated_params = check_argspec(
|
valid, argspec_result, updated_params = check_argspec(
|
||||||
yaml.dump(argspec_obj), self._engine, **params
|
yaml.dump(argspec_obj),
|
||||||
|
self._engine,
|
||||||
|
**params,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
raise AnsibleError(
|
raise AnsibleError(
|
||||||
|
|
|
@ -100,7 +100,10 @@ def validate(*args, **kwargs):
|
||||||
params.update({item: kwargs[item]})
|
params.update({item: kwargs[item]})
|
||||||
|
|
||||||
valid, argspec_result, updated_params = check_argspec(
|
valid, argspec_result, updated_params = check_argspec(
|
||||||
DOCUMENTATION, "validate test", schema_conditionals=ARGSPEC_CONDITIONALS, **params
|
DOCUMENTATION,
|
||||||
|
"validate test",
|
||||||
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
|
**params,
|
||||||
)
|
)
|
||||||
if not valid:
|
if not valid:
|
||||||
raise AnsibleError(
|
raise AnsibleError(
|
||||||
|
|
|
@ -81,7 +81,10 @@ class TestCli_Parse(unittest.TestCase):
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
valid, result, updated_params = check_argspec(
|
valid, result, updated_params = check_argspec(
|
||||||
DOCUMENTATION, "cli_parse module", schema_conditionals={}, **kwargs
|
DOCUMENTATION,
|
||||||
|
"cli_parse module",
|
||||||
|
schema_conditionals={},
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
self.assertEqual(valid, True)
|
self.assertEqual(valid, True)
|
||||||
|
|
||||||
|
@ -94,7 +97,10 @@ class TestCli_Parse(unittest.TestCase):
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
valid, result, updated_params = check_argspec(
|
valid, result, updated_params = check_argspec(
|
||||||
DOCUMENTATION, "cli_parse module", schema_conditionals=ARGSPEC_CONDITIONALS, **kwargs
|
DOCUMENTATION,
|
||||||
|
"cli_parse module",
|
||||||
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertIn("one of the following is required: command, text", result["errors"])
|
self.assertIn("one of the following is required: command, text", result["errors"])
|
||||||
|
@ -103,7 +109,10 @@ class TestCli_Parse(unittest.TestCase):
|
||||||
"""Confirm failed argspec no parser name"""
|
"""Confirm failed argspec no parser name"""
|
||||||
kwargs = {"text": "anything", "parser": {"command": "show version"}}
|
kwargs = {"text": "anything", "parser": {"command": "show version"}}
|
||||||
valid, result, updated_params = check_argspec(
|
valid, result, updated_params = check_argspec(
|
||||||
DOCUMENTATION, "cli_parse module", schema_conditionals=ARGSPEC_CONDITIONALS, **kwargs
|
DOCUMENTATION,
|
||||||
|
"cli_parse module",
|
||||||
|
schema_conditionals=ARGSPEC_CONDITIONALS,
|
||||||
|
**kwargs,
|
||||||
)
|
)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"missing required arguments: name found in parser",
|
"missing required arguments: name found in parser",
|
||||||
|
|
Loading…
Reference in New Issue