From 373b42b5500497e32955ea35ed8b7febbe046643 Mon Sep 17 00:00:00 2001 From: Diego Pino Garcia Date: Fri, 16 Feb 2018 15:41:56 +0000 Subject: [PATCH 1/3] Enable alarm notification --- src/program/lwaftr/setup.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/program/lwaftr/setup.lua b/src/program/lwaftr/setup.lua index a366360ef8..23e7c196bb 100644 --- a/src/program/lwaftr/setup.lua +++ b/src/program/lwaftr/setup.lua @@ -587,13 +587,11 @@ local function compute_worker_configs(conf) end function ptree_manager(f, conf, manager_opts) - -- Always enabled in reconfigurable mode. - alarm_notification = true - local function setup_fn(conf) local worker_app_graphs = {} for worker_id, worker_config in pairs(compute_worker_configs(conf)) do local app_graph = config.new() + worker_config.alarm_notification = true f(app_graph, worker_config) worker_app_graphs[worker_id] = app_graph end From dca505ca67208419ebae5ebc78bbd50b8fdd320c Mon Sep 17 00:00:00 2001 From: Diego Pino Garcia Date: Fri, 16 Feb 2018 16:59:15 +0000 Subject: [PATCH 2/3] Fix variable name --- src/lib/yang/alarms.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/yang/alarms.lua b/src/lib/yang/alarms.lua index 7bcb2d018c..58a6c6e6f9 100644 --- a/src/lib/yang/alarms.lua +++ b/src/lib/yang/alarms.lua @@ -202,7 +202,7 @@ function alarm_list:set_defaults_if_any (key) k = alarm_type_keys:normalize(key) local default = self.defaults[k] if default then - for k,v in pairs(defaults) do + for k,v in pairs(default) do self.list[key][k] = v end end From 191e655cb8cfd702f200374798c5570943bc41b7 Mon Sep 17 00:00:00 2001 From: Diego Pino Garcia Date: Fri, 16 Feb 2018 16:48:17 +0000 Subject: [PATCH 3/3] Fix error message --- src/lib/ptree/ptree.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/ptree/ptree.lua b/src/lib/ptree/ptree.lua index 41ea1119a7..710cf6518b 100644 --- a/src/lib/ptree/ptree.lua +++ b/src/lib/ptree/ptree.lua @@ -290,8 +290,7 @@ end function Manager:rpc_set_alarm_operator_state (args) local function getter() if args.schema ~= self.schema_name then - return false, ("Set-operator-state operation not supported in".. - "'%s' schema"):format(args.schema) + error(("Set-operator-state operation not supported in '%s' schema"):format(args.schema)) end local key = {resource=args.resource, alarm_type_id=args.alarm_type_id, alarm_type_qualifier=args.alarm_type_qualifier} @@ -305,8 +304,7 @@ end function Manager:rpc_purge_alarms (args) local function purge() if args.schema ~= self.schema_name then - return false, ("Purge-alarms operation not supported in".. - "'%s' schema"):format(args.schema) + error(("Purge-alarms operation not supported in '%s' schema"):format(args.schema)) end return { purged_alarms = alarms.purge_alarms(args) } end @@ -317,8 +315,7 @@ end function Manager:rpc_compress_alarms (args) local function compress() if args.schema ~= self.schema_name then - return false, ("Compress-alarms operation not supported in".. - "'%s' schema"):format(args.schema) + error(("Compress-alarms operation not supported in '%s' schema"):format(args.schema)) end return { compressed_alarms = alarms.compress_alarms(args) } end