diff --git a/.bzrignore b/.bzrignore index 6350e986..a2c7a097 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1 +1,2 @@ +bin .coverage diff --git a/Makefile b/Makefile index 2bd83c37..e7b1bce1 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/config.yaml b/config.yaml index 591093dc..4012d97f 100644 --- a/config.yaml +++ b/config.yaml @@ -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. + diff --git a/hooks/quantum_contexts.py b/hooks/quantum_contexts.py index c8b635aa..c13a8c2c 100644 --- a/hooks/quantum_contexts.py +++ b/hooks/quantum_contexts.py @@ -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'),