diff --git a/CHANGELOG.md b/CHANGELOG.md index f5dd55c94..38f2da05a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ Users may have to change how they access the system ### 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: [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 diff --git a/README.md b/README.md index 15c470ce6..d1304b6b5 100644 --- a/README.md +++ b/README.md @@ -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 [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/) diff --git a/apps/restconf/restconf_methods.c b/apps/restconf/restconf_methods.c index a87b7269a..da5e3661a 100644 --- a/apps/restconf/restconf_methods.c +++ b/apps/restconf/restconf_methods.c @@ -267,8 +267,10 @@ api_data_write(clicon_handle h, goto done; goto ok; } - if (ybot) - ymodapi = ys_module(ybot); + if (ybot){ + if (ys_real_module(ybot, &ymodapi) < 0) + goto done; + } } /* 4.4.1: The message-body MUST contain exactly one instance of the * expected data resource. (tested again below) diff --git a/test/test_submodule.sh b/test/test_submodule.sh index 27e91f8e6..83aa6fa62 100755 --- a/test/test_submodule.sh +++ b/test/test_submodule.sh @@ -252,8 +252,12 @@ expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data?content=c 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" -new "restconf edit augment 1" -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" +# Alternative use PUT +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" 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" diff --git a/test/vagrant/vagrant.sh b/test/vagrant/vagrant.sh index c595d0617..fcf387a62 100755 --- a/test/vagrant/vagrant.sh +++ b/test/vagrant/vagrant.sh @@ -141,7 +141,6 @@ case $release in $sshcmd sudo pkg install -y fcgi-devkit nginx ;; native) - $sshcmd sudo pkg install -y libevent ;; esac ;; @@ -167,8 +166,8 @@ case $release in $sshcmd sudo yum install -y nginx ;; native) - $sshcmd sudo yum install -y libevent openssl - $sshcmd sudo yum install -y libevent-devel openssl-devel + $sshcmd sudo yum install -y openssl + $sshcmd sudo yum install -y openssl-devel $sshcmd sudo yum-config-manager --enable powertools $sshcmd sudo yum install -y libnghttp2-devel ;; @@ -245,7 +244,6 @@ case $release in $sshcmd sudo pacman -Syu --noconfirm nginx fcgi ;; native) - $sshcmd sudo pacman -Syu --noconfirm libevent ;; esac ;;