aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-12-03 19:10:58 +0100
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-12-04 15:09:01 +0100
commit3dd9b3710a6724538c9b87581a1d7182808f3ba3 (patch)
tree5f8763f58db0021ffff01d08b3ec40e445121853 /ctl-lib/ctl-config.c
parentb39c6883f7d7d58d60178441c8d408118788418b (diff)
Improve plugin search path
In controller 'plugin' section, use only paths available with 'spath' key to search for plugins. Multiple paths can be specified using ':' character as separator. Environment variables can be used in paths. If a path is not absolute, it will be added two times to search paths list, one with binder root directory as prefix, and one with binding parent directory. BUG-AGL: SPEC-3011 Change-Id: I1e3fd64d523d36a0e0982bbd31d66ae8d9960d3c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 2970955..9039ac5 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -225,7 +225,7 @@ json_object* CtlUpdateSectionConfig(afb_api_t apiHandle, CtlConfigT *ctlHandle,
json_object *sectionArrayJ;
char *oneFile = NULL;
- const char *bindingPath = GetBindingDirPath(apiHandle);
+ const char *bindingParentPath = GetBindingParentDirPath(apiHandle);
if(! json_object_is_type(sectionJ, json_type_array)) {
sectionArrayJ = json_object_new_array();
@@ -243,9 +243,9 @@ json_object* CtlUpdateSectionConfig(afb_api_t apiHandle, CtlConfigT *ctlHandle,
for (int idx=0; idx < length; idx++) {
json_object *oneFileJ = json_object_array_get_idx(filesJ, idx);
json_object *responseJ =
- ScanForConfig(bindingPath, CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json");
+ ScanForConfig(bindingParentPath, CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json");
if(!responseJ) {
- AFB_API_ERROR(apiHandle, "No config files found in search path. No changes has been made\n -- %s", bindingPath);
+ AFB_API_ERROR(apiHandle, "No config files found in search path. No changes has been made\n -- %s", bindingParentPath);
return sectionArrayJ;
}
oneFile = ConfigSearch(apiHandle, responseJ);
@@ -261,9 +261,9 @@ json_object* CtlUpdateSectionConfig(afb_api_t apiHandle, CtlConfigT *ctlHandle,
}
} else {
json_object *responseJ =
- ScanForConfig(bindingPath, CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json");
+ ScanForConfig(bindingParentPath, CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json");
if(!responseJ) {
- AFB_API_ERROR(apiHandle, "No config files found in search path. No changes has been made\n -- %s", bindingPath);
+ AFB_API_ERROR(apiHandle, "No config files found in search path. No changes has been made\n -- %s", bindingParentPath);
return sectionArrayJ;
}
oneFile = ConfigSearch(apiHandle, responseJ);