Skip to content

Commit

Permalink
Fix payload of 'ip access-list XYZ' CLI (#57)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sachinholla authored Aug 9, 2020
1 parent 7465c56 commit 7b93bfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions CLI/actioner/sonic-cli-acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CLI/clitree/cli-xml/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ limitations under the License.
ptype="STRING_63"
>
</PARAM>
<ACTION>python $SONIC_CLI_ROOT/sonic-cli-acl.py patch_openconfig_acl_acl_acl_sets_acl_set ${access-list-name} ACL_IPV4</ACTION>
<ACTION>python $SONIC_CLI_ROOT/sonic-cli-acl.py patch_list_openconfig_acl_acl_acl_sets_acl_set ${access-list-name} ACL_IPV4</ACTION>
</COMMAND>

<!-- no ip access-list -->
Expand Down

0 comments on commit 7b93bfc

Please sign in to comment.