summaryrefslogtreecommitdiffstats
path: root/modules/datacenter_definitions/file.py
diff options
context:
space:
mode:
authorChristos Triantafyllidis <christos.triantafyllidis@gmail.com>2012-06-12 00:49:17 +0300
committerChristos Triantafyllidis <christos.triantafyllidis@gmail.com>2012-06-12 00:49:17 +0300
commitcf9c34812219c3417d9e4d8af4cafaedd1e8988c (patch)
treecef1abdeae93887b20de84202b6d7cd42e713a72 /modules/datacenter_definitions/file.py
downloadDynamicNagiosConfig-cf9c34812219c3417d9e4d8af4cafaedd1e8988c.tar.gz
DynamicNagiosConfig-cf9c34812219c3417d9e4d8af4cafaedd1e8988c.tar.xz
DynamicNagiosConfig-cf9c34812219c3417d9e4d8af4cafaedd1e8988c.zip
Initial GIT import
Diffstat (limited to 'modules/datacenter_definitions/file.py')
-rw-r--r--modules/datacenter_definitions/file.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/datacenter_definitions/file.py b/modules/datacenter_definitions/file.py
new file mode 100644
index 0000000..d66b49d
--- /dev/null
+++ b/modules/datacenter_definitions/file.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+import yaml
+
+def get(config,result):
+ dc_config = yaml.load(file(config["file"], 'r'))
+ for dc in dc_config:
+ if result.has_key(dc):
+ result[dc].update(dc_config[dc])
+ else:
+ result[dc] = dc_config[dc]
+
+ return result \ No newline at end of file