Skip to content

Commit a1121cc

Browse files
authored
Merge pull request snabbco#1022 from dpino/enable-alarm-notification
Reenable alarm notification
2 parents 579d8c8 + 191e655 commit a1121cc

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/lib/ptree/ptree.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ end
290290
function Manager:rpc_set_alarm_operator_state (args)
291291
local function getter()
292292
if args.schema ~= self.schema_name then
293-
return false, ("Set-operator-state operation not supported in"..
294-
"'%s' schema"):format(args.schema)
293+
error(("Set-operator-state operation not supported in '%s' schema"):format(args.schema))
295294
end
296295
local key = {resource=args.resource, alarm_type_id=args.alarm_type_id,
297296
alarm_type_qualifier=args.alarm_type_qualifier}
@@ -305,8 +304,7 @@ end
305304
function Manager:rpc_purge_alarms (args)
306305
local function purge()
307306
if args.schema ~= self.schema_name then
308-
return false, ("Purge-alarms operation not supported in"..
309-
"'%s' schema"):format(args.schema)
307+
error(("Purge-alarms operation not supported in '%s' schema"):format(args.schema))
310308
end
311309
return { purged_alarms = alarms.purge_alarms(args) }
312310
end
@@ -317,8 +315,7 @@ end
317315
function Manager:rpc_compress_alarms (args)
318316
local function compress()
319317
if args.schema ~= self.schema_name then
320-
return false, ("Compress-alarms operation not supported in"..
321-
"'%s' schema"):format(args.schema)
318+
error(("Compress-alarms operation not supported in '%s' schema"):format(args.schema))
322319
end
323320
return { compressed_alarms = alarms.compress_alarms(args) }
324321
end

src/lib/yang/alarms.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function alarm_list:set_defaults_if_any (key)
202202
k = alarm_type_keys:normalize(key)
203203
local default = self.defaults[k]
204204
if default then
205-
for k,v in pairs(defaults) do
205+
for k,v in pairs(default) do
206206
self.list[key][k] = v
207207
end
208208
end

src/program/lwaftr/setup.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,11 @@ local function compute_worker_configs(conf)
587587
end
588588

589589
function ptree_manager(f, conf, manager_opts)
590-
-- Always enabled in reconfigurable mode.
591-
alarm_notification = true
592-
593590
local function setup_fn(conf)
594591
local worker_app_graphs = {}
595592
for worker_id, worker_config in pairs(compute_worker_configs(conf)) do
596593
local app_graph = config.new()
594+
worker_config.alarm_notification = true
597595
f(app_graph, worker_config)
598596
worker_app_graphs[worker_id] = app_graph
599597
end

0 commit comments

Comments
 (0)