From 3dc53da7a5e717a869ef4fd72fbfe530fb19ac5b Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 23 Jan 2023 12:15:40 -0600 Subject: graphql: T4953: remove convert_kwargs_to_snake_case decorator --- op-mode-definitions/show-system.xml.in | 4 ++-- src/op_mode/config_mgmt.py | 10 +++++----- src/services/api/graphql/graphql/mutations.py | 3 +-- src/services/api/graphql/graphql/queries.py | 3 +-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/op-mode-definitions/show-system.xml.in b/op-mode-definitions/show-system.xml.in index 746601f43..85bfdcdba 100644 --- a/op-mode-definitions/show-system.xml.in +++ b/op-mode-definitions/show-system.xml.in @@ -29,13 +29,13 @@ Compare config file revisions - ${vyos_op_scripts_dir}/config_mgmt.py show_commit_diff --rev "$5" --revb "$7" + ${vyos_op_scripts_dir}/config_mgmt.py show_commit_diff --rev "$5" --rev2 "$7" Compare config file revision commands - ${vyos_op_scripts_dir}/config_mgmt.py show_commit_diff --rev "$5" --revb "$7" --commands + ${vyos_op_scripts_dir}/config_mgmt.py show_commit_diff --rev "$5" --rev2 "$7" --commands diff --git a/src/op_mode/config_mgmt.py b/src/op_mode/config_mgmt.py index 0ffb1468b..66de26d1f 100755 --- a/src/op_mode/config_mgmt.py +++ b/src/op_mode/config_mgmt.py @@ -20,17 +20,17 @@ import typing import vyos.opmode from vyos.config_mgmt import ConfigMgmt -def show_commit_diff(raw: bool, rev: int, revb: typing.Optional[int], +def show_commit_diff(raw: bool, rev: int, rev2: typing.Optional[int], commands: bool): config_mgmt = ConfigMgmt() - config_diff = config_mgmt.show_commit_diff(rev, revb, commands) + config_diff = config_mgmt.show_commit_diff(rev, rev2, commands) if raw: - revb = (rev+1) if revb is None else revb + rev2 = (rev+1) if rev2 is None else rev2 if commands: - d = {f'config_command_diff_{revb}_{rev}': config_diff} + d = {f'config_command_diff_{rev2}_{rev}': config_diff} else: - d = {f'config_file_diff_{revb}_{rev}': config_diff} + d = {f'config_file_diff_{rev2}_{rev}': config_diff} return d return config_diff diff --git a/src/services/api/graphql/graphql/mutations.py b/src/services/api/graphql/graphql/mutations.py index 87ea59c43..8254e22b1 100644 --- a/src/services/api/graphql/graphql/mutations.py +++ b/src/services/api/graphql/graphql/mutations.py @@ -15,7 +15,7 @@ from importlib import import_module from typing import Any, Dict, Optional -from ariadne import ObjectType, convert_kwargs_to_snake_case, convert_camel_case_to_snake +from ariadne import ObjectType, convert_camel_case_to_snake from graphql import GraphQLResolveInfo from makefun import with_signature @@ -45,7 +45,6 @@ def make_mutation_resolver(mutation_name, class_name, session_func): func_sig = '(obj: Any, info: GraphQLResolveInfo, data: Optional[Dict]=None)' @mutation.field(mutation_name) - @convert_kwargs_to_snake_case @with_signature(func_sig, func_name=resolver_name) async def func_impl(*args, **kwargs): try: diff --git a/src/services/api/graphql/graphql/queries.py b/src/services/api/graphql/graphql/queries.py index 1ad586428..daccc19b2 100644 --- a/src/services/api/graphql/graphql/queries.py +++ b/src/services/api/graphql/graphql/queries.py @@ -15,7 +15,7 @@ from importlib import import_module from typing import Any, Dict, Optional -from ariadne import ObjectType, convert_kwargs_to_snake_case, convert_camel_case_to_snake +from ariadne import ObjectType, convert_camel_case_to_snake from graphql import GraphQLResolveInfo from makefun import with_signature @@ -45,7 +45,6 @@ def make_query_resolver(query_name, class_name, session_func): func_sig = '(obj: Any, info: GraphQLResolveInfo, data: Optional[Dict]=None)' @query.field(query_name) - @convert_kwargs_to_snake_case @with_signature(func_sig, func_name=resolver_name) async def func_impl(*args, **kwargs): try: -- cgit v1.2.3