This commit is contained in:
James Page 2014-04-10 17:50:13 +01:00
commit 8a9c1a09ea
7 changed files with 38 additions and 5 deletions

View File

@ -58,6 +58,11 @@ options:
default: False
type: boolean
description: Enable verbose logging
use-syslog:
type: boolean
default: False
description: |
If set to True, supporting services will log to syslog.
instance-mtu:
type: int
description: |

View File

@ -31,6 +31,9 @@ from charmhelpers.contrib.openstack.neutron import (
)
import charmhelpers.contrib.openstack.context as context
from charmhelpers.contrib.openstack.context import (
SyslogContext
)
import charmhelpers.contrib.openstack.templating as templating
from charmhelpers.contrib.openstack.neutron import headers_package
from quantum_contexts import (
@ -177,7 +180,8 @@ NOVA_CONFIG_FILES = {
context.SharedDBContext(ssl_dir=NOVA_CONF_DIR),
context.PostgresqlDBContext(),
NetworkServiceContext(),
QuantumGatewayContext()],
QuantumGatewayContext(),
SyslogContext()],
'services': ['nova-api-metadata']
},
}
@ -215,7 +219,8 @@ NEUTRON_SHARED_CONFIG_FILES.update(NOVA_CONFIG_FILES)
QUANTUM_OVS_CONFIG_FILES = {
QUANTUM_CONF: {
'hook_contexts': [context.AMQPContext(ssl_dir=QUANTUM_CONF_DIR),
QuantumGatewayContext()],
QuantumGatewayContext(),
SyslogContext()],
'services': ['quantum-l3-agent',
'quantum-dhcp-agent',
'quantum-metadata-agent',
@ -240,7 +245,8 @@ QUANTUM_OVS_CONFIG_FILES.update(QUANTUM_SHARED_CONFIG_FILES)
NEUTRON_OVS_CONFIG_FILES = {
NEUTRON_CONF: {
'hook_contexts': [context.AMQPContext(ssl_dir=NEUTRON_CONF_DIR),
QuantumGatewayContext()],
QuantumGatewayContext(),
SyslogContext()],
'services': ['neutron-l3-agent',
'neutron-dhcp-agent',
'neutron-metadata-agent',

View File

@ -4,6 +4,7 @@ state_path=/var/lib/nova
lock_path=/var/lock/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
verbose=True
use_syslog = {{ use_syslog }}
api_paste_config=/etc/nova/api-paste.ini
enabled_apis=metadata
multi_host=True

View File

@ -1,6 +1,7 @@
[DEFAULT]
verbose = {{ verbose }}
debug = {{ debug }}
use_syslog = {{ use_syslog }}
lock_path = /var/lock/quantum
core_plugin = {{ core_plugin }}
rabbit_userid = {{ rabbitmq_user }}

View File

@ -5,8 +5,9 @@
[DEFAULT]
verbose = {{ verbose }}
debug = {{ debug }}
use_syslog = {{ use_syslog }}
lock_path = /var/lock/neutron
core_plugin = {{ core_plugin }}
core_plugin = {{ core_plugin }}
{% include "parts/rabbitmq" %}
control_exchange = neutron
notification_driver = neutron.openstack.common.notifier.list_notifier

View File

@ -8,6 +8,7 @@ state_path=/var/lib/nova
lock_path=/var/lock/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
verbose= {{ verbose }}
use_syslog = {{ use_syslog }}
api_paste_config=/etc/nova/api-paste.ini
enabled_apis=metadata
multi_host=True

View File

@ -1,5 +1,10 @@
from mock import MagicMock, patch
from mock import (
Mock,
MagicMock,
patch
)
import quantum_contexts
import sys
from contextlib import contextmanager
from test_utils import (
@ -244,6 +249,19 @@ class TestHostIP(CharmTestCase):
super(TestHostIP, self).setUp(quantum_contexts,
TO_PATCH)
self.config.side_effect = self.test_config.get
# Save and inject
self.mods = {'dns': None, 'dns.resolver': None}
for mod in self.mods:
if mod not in sys.modules:
sys.modules[mod] = Mock()
else:
del self.mods[mod]
def tearDown(self):
super(TestHostIP, self).tearDown()
# Cleanup
for mod in self.mods.keys():
del sys.modules[mod]
def test_get_host_ip_already_ip(self):
self.assertEquals(quantum_contexts.get_host_ip('10.5.0.1'),