Skip to content

Commit

Permalink
Fixed: [Restconf PATCH method request failed on item defined by submo…
Browse files Browse the repository at this point in the history
…dule #306](#306)
  • Loading branch information
olofhagsand committed Feb 23, 2022
1 parent 97316e0 commit 2291275
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
6 changes: 4 additions & 2 deletions apps/restconf/restconf_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions test/test_submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 2 additions & 4 deletions test/vagrant/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ case $release in
$sshcmd sudo pkg install -y fcgi-devkit nginx
;;
native)
$sshcmd sudo pkg install -y libevent
;;
esac
;;
Expand All @@ -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
;;
Expand Down Expand Up @@ -245,7 +244,6 @@ case $release in
$sshcmd sudo pacman -Syu --noconfirm nginx fcgi
;;
native)
$sshcmd sudo pacman -Syu --noconfirm libevent
;;
esac
;;
Expand Down

0 comments on commit 2291275

Please sign in to comment.