From b674e5e22a576067e69731efbed3267aacabc7e2 Mon Sep 17 00:00:00 2001 From: Sachin Holla Date: Tue, 21 Jul 2020 10:09:45 +0530 Subject: [PATCH] Fix payload of 'ip access-list XYZ' CLI CLI handler for 'ip access-list XYZ' was not sednding RESTCONF compliant payload earlier. New ygot code does not accept it. Modified the actioner to use 'PATCH /restconf/data/openconfig-acl:acl/acl-sets/acl-set' request with correct payload. --- CLI/actioner/sonic-cli-acl.py | 14 +++++++++----- CLI/clitree/cli-xml/acl.xml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CLI/actioner/sonic-cli-acl.py b/CLI/actioner/sonic-cli-acl.py index f694c29db9..a526a0141a 100755 --- a/CLI/actioner/sonic-cli-acl.py +++ b/CLI/actioner/sonic-cli-acl.py @@ -58,13 +58,17 @@ def generate_body(func, args): keypath = [ args[0], args[1] ] # Configure ACL table - elif func.__name__ == 'patch_openconfig_acl_acl_acl_sets_acl_set' : - keypath = [ args[0], args[1] ] - body = { "openconfig-acl:config": { + elif func.__name__ == 'patch_list_openconfig_acl_acl_acl_sets_acl_set' : + keypath = [] + body = { "openconfig-acl:acl-set": [{ "name": args[0], "type": args[1], - "description": "" - } + "config": { + "name": args[0], + "type": args[1], + "description": "" + } + }] } # Configure ACL rule specific to an ACL table diff --git a/CLI/clitree/cli-xml/acl.xml b/CLI/clitree/cli-xml/acl.xml index b78c72f459..b301a48028 100644 --- a/CLI/clitree/cli-xml/acl.xml +++ b/CLI/clitree/cli-xml/acl.xml @@ -111,7 +111,7 @@ limitations under the License. ptype="STRING_63" > - python $SONIC_CLI_ROOT/sonic-cli-acl.py patch_openconfig_acl_acl_acl_sets_acl_set ${access-list-name} ACL_IPV4 + python $SONIC_CLI_ROOT/sonic-cli-acl.py patch_list_openconfig_acl_acl_acl_sets_acl_set ${access-list-name} ACL_IPV4