瀏覽代碼

Print helpful exception is pillar node information is missing (or otherwise broken).

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm 7 年之前
父節點
當前提交
b4f3a8919f
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      _modules/ffho_auth.py

+ 3 - 0
_modules/ffho_auth.py

@@ -7,6 +7,9 @@
 import collections
 
 def _ssh_user_allowed (access_config, node_id, node_config, entry_name):
+	if type (node_config) not in [ dict, collections.OrderedDict ]:
+		raise Exception ("The pillar node config of node \"%s\" seem to be broken or missing!" % node_id)
+
 	roles = node_config.get ('roles', [])
 
 	# Access config for the given user is the string "global"