summaryrefslogtreecommitdiffstats
path: root/deploy/config/network.py
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/config/network.py')
-rw-r--r--deploy/config/network.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/deploy/config/network.py b/deploy/config/network.py
new file mode 100644
index 00000000..ed14f95b
--- /dev/null
+++ b/deploy/config/network.py
@@ -0,0 +1,20 @@
+import yaml
+
+from deploy.common import query
+
+
+class NetworkConfig(object):
+ def __init__(self, network_file):
+ self._file = network_file
+ self._get_config()
+
+ def _get_config(self):
+ self.config = yaml.safe_load(file(self._file))
+
+ def _get_network(self, name):
+ return query.find(lambda item: item['name'] == name,
+ self.config['networks'])
+
+ @property
+ def external_network(self):
+ return self._get_network('EXTERNAL')