From e62117170f9dd562cdb85bf6bd95644655e046c2 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 15 Mar 2017 14:31:36 +0800 Subject: add default_floating_pool configuration for nova-api Change-Id: I9db5509667e9c10a9c07b55531c6d78fb95cc223 Signed-off-by: SerenaFeng --- deploy/config/__init__.py | 0 deploy/config/network.py | 20 ++++++++++++++++++++ .../config/vm_environment/zte-virtual1/network.yml | 21 +++++++++++---------- 3 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 deploy/config/__init__.py create mode 100644 deploy/config/network.py (limited to 'deploy/config') diff --git a/deploy/config/__init__.py b/deploy/config/__init__.py new file mode 100644 index 00000000..e69de29b 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') diff --git a/deploy/config/vm_environment/zte-virtual1/network.yml b/deploy/config/vm_environment/zte-virtual1/network.yml index 7d746be6..6c8a2824 100644 --- a/deploy/config/vm_environment/zte-virtual1/network.yml +++ b/deploy/config/vm_environment/zte-virtual1/network.yml @@ -17,8 +17,8 @@ networks: - cidr: '10.20.11.0/24' gateway: '10.20.11.1' ip_ranges: - - 'start': '10.20.11.3' - 'end': '10.20.11.10' + - start: '10.20.11.3' + end: '10.20.11.10' name: 'MANAGEMENT' - cidr: '10.20.11.0/24' gateway: '10.20.11.1' @@ -27,22 +27,23 @@ networks: end: '10.20.11.10' name: 'STORAGE' - cidr: '172.10.101.0/24' - gateway: '172.10.101.0' + gateway: '172.10.101.1' ip_ranges: - - 'start': '172.10.101.1' - 'end': '172.10.101.10' - 'name': 'EXTERNAL' + - start: 172.10.101.2 + end: 172.10.101.20 + name: EXTERNAL + network_name: admin_external - cidr: '10.20.11.0/24' gateway: '10.20.11.1' ip_ranges: - - 'start': '10.20.11.3' - 'end': '10.20.11.10' + - start: '10.20.11.3' + end: '10.20.11.10' name: 'PUBLICAPI' - cidr: '10.20.11.0/24' gateway: '10.20.11.1' ip_ranges: - - 'start': '10.20.11.3' - 'end': '10.20.11.10' + - start: '10.20.11.3' + end: '10.20.11.10' name: 'TENANT' interfaces: - name: 'EXTERNAL' -- cgit 1.2.3-korg