From 2eae2b6000ea2e61ad90b2eada7fed3e1d7e7d37 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 20 Feb 2020 15:08:25 +0100 Subject: [PATCH] extension search index --- CHANGELOG.md | 40 +++++++++++------------ apps/netconf/netconf_rpc.c | 4 --- test/cicd/cicd.sh | 1 + test/test_choice.sh | 2 +- yang/clixon/clixon-config@2019-09-11.yang | 4 +++ 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39782d87..81a2e701 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,24 @@ # Clixon Changelog -* [4.4.0](#4.4.0) Upcoming - * [4.3.3](#4.3.3) - * [4.3.2](#4.3.2) - * [4.3.1](#4.3.1) -* [4.3.0](#4.3.0) 1 January 2020 -* [4.2.0](#4.2.0) 27 October 2019 -* [4.1.0](#4.1.0) 18 August 2019 - * [4.0.1](#4.0.1) -* [4.0.0](#4.0.0) 13 July 2019 -* [3.9.0](#3.9.0) 21 Feb 2019 -* [3.8.0](#3.8.0) 6 Nov 2018 -* [3.7.0](#3.7.0) 22 July 2018 - * [3.6.1](#3.6.1) -* [3.6.0](#3.6.0) 30 April 2018 -* [3.5.0](#3.5.0) 12 February 2018 -* [3.4.0](#3.4.0) 1 January 2018 -* [3.3.3](#3.3.3) 25 November 2017 -* [3.3.2](#3.3.2) Aug 27 2017 -* [3.3.1](#3.3.1) June 7 2017 +* [4.4.0](#4-4-0) Upcoming + * [4.3.3](#4-3-3) + * [4.3.2](#4-3-2) + * [4.3.1](#4-3-1) +* [4.3.0](#4-3-0) 1 January 2020 +* [4.2.0](#4-2-0) 27 October 2019 +* [4.1.0](#4-1-0) 18 August 2019 + * [4.0.1](#4-0-1) +* [4.0.0](#4-0-0) 13 July 2019 +* [3.9.0](#3-9-0) 21 Feb 2019 +* [3.8.0](#3-8-0) 6 Nov 2018 +* [3.7.0](#3-7-0) 22 July 2018 + * [3.6.1](#3-6-1) +* [3.6.0](#3-6-0) 30 April 2018 +* [3.5.0](#3-5-0) 12 February 2018 +* [3.4.0](#3-4-0) 1 January 2018 +* [3.3.3](#3-3-3) 25 November 2017 +* [3.3.2](#3-3-2) Aug 27 2017 +* [3.3.1](#3-3-1) June 7 2017 ## 4.4.0 Expected: February 2020 @@ -37,7 +37,7 @@ Expected: February 2020 * You can also register explicit indexes for making binary search (not only list keys) * For more info, see docs at [paths](https://clixon-docs.readthedocs.io/en/latest/paths.html) and [search](https://clixon-docs.readthedocs.io/en/latest/xml.html#searching-in-xml) - + * Experimental: explicit search index, ie index any list variable, not just keys ### API changes on existing features (you may need to change your code) * JSON parse error messages change from ` on line x: syntax error,..` to `json_parse: line x: syntax error` * Unknown-element error message is more descriptive, eg from `namespace is: urn:example:clixon` to: `Failed to find YANG spec of XML node: x with parent: xp in namespace urn:example:clixon`. diff --git a/apps/netconf/netconf_rpc.c b/apps/netconf/netconf_rpc.c index 74d3f3ee..649d60c5 100644 --- a/apps/netconf/netconf_rpc.c +++ b/apps/netconf/netconf_rpc.c @@ -162,8 +162,6 @@ netconf_get_config(clicon_handle h, int retval = -1; cxobj *xfilter; /* filter */ char *ftype = NULL; - cxobj *xdata; - yang_stmt *yspec; /* ie ... */ if ((xfilter = xpath_first(xn, NULL, "filter")) != NULL) @@ -361,8 +359,6 @@ netconf_get(clicon_handle h, int retval = -1; cxobj *xfilter; /* filter */ char *ftype = NULL; - cxobj *xdata; - yang_stmt *yspec; /* ie ... */ if ((xfilter = xpath_first(xn, NULL, "filter")) != NULL) diff --git a/test/cicd/cicd.sh b/test/cicd/cicd.sh index 20789633..660ef33b 100755 --- a/test/cicd/cicd.sh +++ b/test/cicd/cicd.sh @@ -27,6 +27,7 @@ fi h=$1 +ssh -t $h "test -d src || mkdir src" ssh -t $h "test -d src/cligen || (cd src;git clone https://github.com/olofhagsand/cligen.git)" ssh -t $h "(cd src/cligen;git pull)" ssh -t $h "(cd src/cligen;./configure)" diff --git a/test/test_choice.sh b/test/test_choice.sh index 17419bb6..d67dcb5d 100755 --- a/test/test_choice.sh +++ b/test/test_choice.sh @@ -180,7 +180,7 @@ new "restconf get protocol tcp" expecteq "$(curl -s -X GET http://localhost/restconf/data/system:system)" 0 '{"system:system":{"protocol":{"tcp":[null]}}} ' -new "restconf set protocol tcp+udp fail" +new "restconf set protocol tcp+udp fail again" expecteq "$(curl -s -X PUT -H "Content-Type: application/yang-data+json" http://localhost/restconf/data/system:system/protocol -d '{"system:protocol":{"tcp": [null], "udp": [null]}}')" 0 '{"ietf-restconf:errors":{"error":{"error-type":"application","error-tag":"bad-element","error-info":{"bad-element":"udp"},"error-severity":"error","error-message":"Element in choice statement already exists"}}} ' new "cli set protocol udp" diff --git a/yang/clixon/clixon-config@2019-09-11.yang b/yang/clixon/clixon-config@2019-09-11.yang index 84a9ab9e..7679fabe 100644 --- a/yang/clixon/clixon-config@2019-09-11.yang +++ b/yang/clixon/clixon-config@2019-09-11.yang @@ -67,6 +67,10 @@ module clixon-config { description "Released in Clixon 3.8"; } + extension search_index { + description "This list argument acts as a search index using optimized binary search. + "; + } typedef startup_mode{ description "Which method to boot/start clicon backend.