[jamespage,r=gnuoy] Add support for multiple network configuration

This commit is contained in:
Liam Young 2014-07-29 09:08:35 +01:00
commit 3278294236
4 changed files with 28 additions and 9 deletions

View File

@ -1 +1,2 @@
bin
.coverage

View File

@ -2,13 +2,21 @@
PYTHON := /usr/bin/env python
lint:
@flake8 --exclude hooks/charmhelpers hooks
@flake8 --exclude hooks/charmhelpers unit_tests tests
@flake8 --exclude hooks/charmhelpers hooks unit_tests tests
@charm proof
unit_test:
@echo Starting unit tests...
@$(PYTHON) /usr/bin/nosetests --nologcapture unit_tests
@$(PYTHON) /usr/bin/nosetests --nologcapture --with-coverage unit_tests
bin/charm_helpers_sync.py:
@mkdir -p bin
@bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
> bin/charm_helpers_sync.py
sync: bin/charm_helpers_sync.py
@$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-hooks.yaml
@$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-tests.yaml
test:
@echo Starting Amulet tests...
@ -17,10 +25,6 @@ test:
# https://bugs.launchpad.net/amulet/+bug/1320357
@juju test -v -p AMULET_HTTP_PROXY
sync:
@charm-helper-sync -c charm-helpers-hooks.yaml
@charm-helper-sync -c charm-helpers-tests.yaml
publish: lint test
publish: lint unit_test
bzr push lp:charms/quantum-gateway
bzr push lp:charms/trusty/quantum-gateway

View File

@ -86,3 +86,14 @@ options:
default: nova
type: string
description: Database name
# Network configuration options
# by default all access is over 'private-address'
os-data-network:
type: string
description: |
The IP address and netmask of the OpenStack Data network (e.g.,
192.168.0.0/24)
.
This network will be used for tenant network traffic in overlay
networks.

View File

@ -28,6 +28,7 @@ from charmhelpers.contrib.hahelpers.cluster import(
eligible_leader
)
import re
from charmhelpers.contrib.network.ip import get_address_in_network
DB_USER = "quantum"
QUANTUM_DB = "quantum"
@ -164,7 +165,9 @@ class QuantumGatewayContext(OSContextGenerator):
def __call__(self):
ctxt = {
'shared_secret': get_shared_secret(),
'local_ip': get_host_ip(), # XXX: data network impact
'local_ip':
get_address_in_network(config('os-data-network'),
get_host_ip(unit_get('private-address'))),
'core_plugin': core_plugin(),
'plugin': config('plugin'),
'debug': config('debug'),