Commit 43f3ae57 authored by Ad Schellevis's avatar Ad Schellevis

(configd) configd actions missed second level actions, output is fine now but...

(configd) configd actions missed second level actions, output is fine now but nesting actions may need some more thinking
parent bd5f92be
......@@ -285,13 +285,25 @@ class ActionHandler(object):
result = {}
for command in self.action_map:
for action in self.action_map[command]:
cmd='%s %s'%(command,action)
result[cmd] = {}
for actAttr in attributes:
if hasattr(self.action_map[command][action], actAttr):
result[cmd][actAttr] = getattr(self.action_map[command][action], actAttr)
else:
result[cmd][actAttr] = ''
if type(self.action_map[command][action]) == dict:
# parse second level actions
# TODO: nesting actions may be better to solve recursive in here and in load_config part
for subAction in self.action_map[command][action]:
cmd='%s %s %s'%(command,action,subAction)
result[cmd] = {}
for actAttr in attributes:
if hasattr(self.action_map[command][action][subAction], actAttr):
result[cmd][actAttr] = getattr(self.action_map[command][action][subAction], actAttr)
else:
result[cmd][actAttr] = ''
else:
cmd='%s %s'%(command,action)
result[cmd] = {}
for actAttr in attributes:
if hasattr(self.action_map[command][action], actAttr):
result[cmd][actAttr] = getattr(self.action_map[command][action], actAttr)
else:
result[cmd][actAttr] = ''
return result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment