Fixed: [Restconf PATCH method request failed on item defined by submodule #306](https://github.com/clicon/clixon/issues/306)

This commit is contained in:
Olof hagsand 2022-02-23 11:20:52 +01:00
parent 97316e0bfa
commit 2291275fae
5 changed files with 14 additions and 9 deletions

View file

@ -70,6 +70,7 @@ Users may have to change how they access the system
### Corrected Bugs ### Corrected Bugs
* Fixed: [ Restconf PATCH method request failed on item defined by submodule #306](https://github.com/clicon/clixon/issues/306)
* Fixed: [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303) * Fixed: [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303)
* Fixed: [statement: require-instance should be true if not present according to rfc7950 Sec 9.9.3](https://github.com/clicon/clixon/issues/302) * Fixed: [statement: require-instance should be true if not present according to rfc7950 Sec 9.9.3](https://github.com/clicon/clixon/issues/302)
* See also API changes * See also API changes

View file

@ -17,6 +17,6 @@ Clixon has a master branch continuously tested with CI, but releases are made ca
Clixon interaction is best done posting issues, pull requests, or joining the Clixon interaction is best done posting issues, pull requests, or joining the
[slack channel](https://clixondev.slack.com). [slack channel](https://clixondev.slack.com).
[Slack invite](https://join.slack.com/t/clixondev/shared_invite/zt-11yvaaum9-J4zEVnp~8KkTXFlQSE0Kmg)(updated 20/1 2022) [Slack invite](https://join.slack.com/t/clixondev/shared_invite/zt-14apfsdlt-U8y5TX_VX7oP99wKKvTScQ)(updated 23/2 2022)
Clixon is sponsored by [Rubicon Communications LLC(Netgate)](https://www.netgate.com/) Clixon is sponsored by [Rubicon Communications LLC(Netgate)](https://www.netgate.com/)

View file

@ -267,8 +267,10 @@ api_data_write(clicon_handle h,
goto done; goto done;
goto ok; goto ok;
} }
if (ybot) if (ybot){
ymodapi = ys_module(ybot); if (ys_real_module(ybot, &ymodapi) < 0)
goto done;
}
} }
/* 4.4.1: The message-body MUST contain exactly one instance of the /* 4.4.1: The message-body MUST contain exactly one instance of the
* expected data resource. (tested again below) * expected data resource. (tested again below)

View file

@ -252,8 +252,12 @@ expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data?content=c
new "restconf edit augment 0" new "restconf edit augment 0"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:sub2 -d '{"main:aug0":"foo"}')" 0 "HTTP/$HVER 201" expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:sub2 -d '{"main:aug0":"foo"}')" 0 "HTTP/$HVER 201"
new "restconf edit augment 1" # Alternative use PUT
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:main -d '{"main:aug1":"foo"}')" 0 "HTTP/$HVER 201" new "restconf PUT augment 1 "
expectpart "$(curl $CURLOPTS -X PUT -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:main/aug1 -d '{"main:aug1":"foo"}')" 0 "HTTP/$HVER 201"
new "restconf PATCH augment 1 "
expectpart "$(curl $CURLOPTS -X PATCH -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:main/aug1 -d '{"main:aug1":"foo"}')" 0 "HTTP/$HVER 204"
new "restconf edit augment 2" new "restconf edit augment 2"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:sub2 -d '{"main:aug2":"foo"}')" 0 "HTTP/$HVER 201" expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:sub2 -d '{"main:aug2":"foo"}')" 0 "HTTP/$HVER 201"

View file

@ -141,7 +141,6 @@ case $release in
$sshcmd sudo pkg install -y fcgi-devkit nginx $sshcmd sudo pkg install -y fcgi-devkit nginx
;; ;;
native) native)
$sshcmd sudo pkg install -y libevent
;; ;;
esac esac
;; ;;
@ -167,8 +166,8 @@ case $release in
$sshcmd sudo yum install -y nginx $sshcmd sudo yum install -y nginx
;; ;;
native) native)
$sshcmd sudo yum install -y libevent openssl $sshcmd sudo yum install -y openssl
$sshcmd sudo yum install -y libevent-devel openssl-devel $sshcmd sudo yum install -y openssl-devel
$sshcmd sudo yum-config-manager --enable powertools $sshcmd sudo yum-config-manager --enable powertools
$sshcmd sudo yum install -y libnghttp2-devel $sshcmd sudo yum install -y libnghttp2-devel
;; ;;
@ -245,7 +244,6 @@ case $release in
$sshcmd sudo pacman -Syu --noconfirm nginx fcgi $sshcmd sudo pacman -Syu --noconfirm nginx fcgi
;; ;;
native) native)
$sshcmd sudo pacman -Syu --noconfirm libevent
;; ;;
esac esac
;; ;;