app.py: inventory - account for non-existing facts
Set the fact value to be displayed in the inventory tab to "undef" if the fact does not exist for a node.
This commit is contained in:
@@ -227,7 +227,10 @@ def inventory():
|
||||
for node in nodelist:
|
||||
nodedata[node] = []
|
||||
for fact_name in fact_names:
|
||||
try:
|
||||
nodedata[node].append(factvalues[node,fact_name])
|
||||
except KeyError:
|
||||
nodedata[node].append("undef")
|
||||
|
||||
return Response(stream_with_context(
|
||||
stream_template('inventory.html', nodedata=nodedata, fact_desc=fact_desc)))
|
||||
|
||||
Reference in New Issue
Block a user