Merge lp:~hopem/charms/precise/quantum-gateway/lp1273067 into lp:charms/quantum-gateway
- Precise Pangolin (12.04)
- lp1273067
- Merge into trunk
Proposed by
Edward Hope-Morley
Status: | Merged |
---|---|
Merged at revision: | 46 |
Proposed branch: | lp:~hopem/charms/precise/quantum-gateway/lp1273067 |
Merge into: | lp:charms/quantum-gateway |
Diff against target: |
412 lines (+134/-32) 15 files modified
config.yaml (+5/-0) hooks/charmhelpers/contrib/openstack/context.py (+9/-6) hooks/charmhelpers/contrib/openstack/neutron.py (+28/-4) hooks/charmhelpers/contrib/openstack/utils.py (+16/-13) hooks/charmhelpers/contrib/storage/linux/utils.py (+2/-1) hooks/charmhelpers/fetch/__init__.py (+23/-0) hooks/charmhelpers/fetch/archiveurl.py (+15/-0) hooks/quantum_utils.py (+9/-3) revision (+1/-1) templates/folsom/metadata_agent.ini (+1/-1) templates/folsom/nova.conf (+1/-0) templates/folsom/quantum.conf (+1/-0) templates/havana/neutron.conf (+1/-0) templates/havana/nova.conf (+1/-0) unit_tests/test_quantum_contexts.py (+21/-3) |
To merge this branch: | bzr merge lp:~hopem/charms/precise/quantum-gateway/lp1273067 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Edward Hope-Morley | Approve | ||
Review via email: mp+212717@code.launchpad.net |
Commit message
Description of the change
The is part of a resubmit for all the charm use-syslog patches since the previous attempts were getting messy
To post a comment you must log in.
- 48. By Edward Hope-Morley
-
[hopem] removed extraneous use_syslog from .ini files since neutron.conf & quantum.conf should suffice
Revision history for this message
Edward Hope-Morley (hopem) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'config.yaml' | |||
2 | --- config.yaml 2014-03-14 13:16:57 +0000 | |||
3 | +++ config.yaml 2014-03-26 11:07:00 +0000 | |||
4 | @@ -50,6 +50,11 @@ | |||
5 | 50 | type: string | 50 | type: string |
6 | 51 | description: RabbitMQ Virtual Host | 51 | description: RabbitMQ Virtual Host |
7 | 52 | default: openstack | 52 | default: openstack |
8 | 53 | use-syslog: | ||
9 | 54 | type: boolean | ||
10 | 55 | default: False | ||
11 | 56 | description: | | ||
12 | 57 | If set to True, supporting services will log to syslog. | ||
13 | 53 | instance-mtu: | 58 | instance-mtu: |
14 | 54 | type: int | 59 | type: int |
15 | 55 | description: | | 60 | description: | |
16 | 56 | 61 | ||
17 | === modified file 'hooks/charmhelpers/contrib/openstack/context.py' | |||
18 | --- hooks/charmhelpers/contrib/openstack/context.py 2014-03-14 13:24:39 +0000 | |||
19 | +++ hooks/charmhelpers/contrib/openstack/context.py 2014-03-26 11:07:00 +0000 | |||
20 | @@ -199,6 +199,7 @@ | |||
21 | 199 | 199 | ||
22 | 200 | ctxt = {} | 200 | ctxt = {} |
23 | 201 | for rid in relation_ids('amqp'): | 201 | for rid in relation_ids('amqp'): |
24 | 202 | ha_vip_only = False | ||
25 | 202 | for unit in related_units(rid): | 203 | for unit in related_units(rid): |
26 | 203 | if relation_get('clustered', rid=rid, unit=unit): | 204 | if relation_get('clustered', rid=rid, unit=unit): |
27 | 204 | ctxt['clustered'] = True | 205 | ctxt['clustered'] = True |
28 | @@ -213,16 +214,18 @@ | |||
29 | 213 | unit=unit), | 214 | unit=unit), |
30 | 214 | 'rabbitmq_virtual_host': vhost, | 215 | 'rabbitmq_virtual_host': vhost, |
31 | 215 | }) | 216 | }) |
32 | 217 | if relation_get('ha_queues', rid=rid, unit=unit) is not None: | ||
33 | 218 | ctxt['rabbitmq_ha_queues'] = True | ||
34 | 219 | |||
35 | 220 | ha_vip_only = relation_get('ha-vip-only', | ||
36 | 221 | rid=rid, unit=unit) is not None | ||
37 | 222 | |||
38 | 216 | if context_complete(ctxt): | 223 | if context_complete(ctxt): |
39 | 217 | # Sufficient information found = break out! | 224 | # Sufficient information found = break out! |
40 | 218 | break | 225 | break |
41 | 219 | # Used for active/active rabbitmq >= grizzly | 226 | # Used for active/active rabbitmq >= grizzly |
48 | 220 | if ('clustered' not in ctxt or relation_get('ha-vip-only') == 'True') and \ | 227 | if ('clustered' not in ctxt or ha_vip_only) \ |
49 | 221 | len(related_units(rid)) > 1: | 228 | and len(related_units(rid)) > 1: |
44 | 222 | if relation_get('ha_queues'): | ||
45 | 223 | ctxt['rabbitmq_ha_queues'] = relation_get('ha_queues') | ||
46 | 224 | else: | ||
47 | 225 | ctxt['rabbitmq_ha_queues'] = False | ||
50 | 226 | rabbitmq_hosts = [] | 229 | rabbitmq_hosts = [] |
51 | 227 | for unit in related_units(rid): | 230 | for unit in related_units(rid): |
52 | 228 | rabbitmq_hosts.append(relation_get('private-address', | 231 | rabbitmq_hosts.append(relation_get('private-address', |
53 | 229 | 232 | ||
54 | === modified file 'hooks/charmhelpers/contrib/openstack/neutron.py' | |||
55 | --- hooks/charmhelpers/contrib/openstack/neutron.py 2013-11-06 03:57:51 +0000 | |||
56 | +++ hooks/charmhelpers/contrib/openstack/neutron.py 2014-03-26 11:07:00 +0000 | |||
57 | @@ -18,6 +18,22 @@ | |||
58 | 18 | return 'linux-headers-%s' % kver | 18 | return 'linux-headers-%s' % kver |
59 | 19 | 19 | ||
60 | 20 | 20 | ||
61 | 21 | def kernel_version(): | ||
62 | 22 | """ Retrieve the current major kernel version as a tuple e.g. (3, 13) """ | ||
63 | 23 | kver = check_output(['uname', '-r']).strip() | ||
64 | 24 | kver = kver.split('.') | ||
65 | 25 | return (int(kver[0]), int(kver[1])) | ||
66 | 26 | |||
67 | 27 | |||
68 | 28 | def determine_dkms_package(): | ||
69 | 29 | """ Determine which DKMS package should be used based on kernel version """ | ||
70 | 30 | # NOTE: 3.13 kernels have support for GRE and VXLAN native | ||
71 | 31 | if kernel_version() >= (3, 13): | ||
72 | 32 | return [] | ||
73 | 33 | else: | ||
74 | 34 | return ['openvswitch-datapath-dkms'] | ||
75 | 35 | |||
76 | 36 | |||
77 | 21 | # legacy | 37 | # legacy |
78 | 22 | def quantum_plugins(): | 38 | def quantum_plugins(): |
79 | 23 | from charmhelpers.contrib.openstack import context | 39 | from charmhelpers.contrib.openstack import context |
80 | @@ -32,7 +48,7 @@ | |||
81 | 32 | database=config('neutron-database'), | 48 | database=config('neutron-database'), |
82 | 33 | relation_prefix='neutron')], | 49 | relation_prefix='neutron')], |
83 | 34 | 'services': ['quantum-plugin-openvswitch-agent'], | 50 | 'services': ['quantum-plugin-openvswitch-agent'], |
85 | 35 | 'packages': [[headers_package(), 'openvswitch-datapath-dkms'], | 51 | 'packages': [[headers_package()] + determine_dkms_package(), |
86 | 36 | ['quantum-plugin-openvswitch-agent']], | 52 | ['quantum-plugin-openvswitch-agent']], |
87 | 37 | 'server_packages': ['quantum-server', | 53 | 'server_packages': ['quantum-server', |
88 | 38 | 'quantum-plugin-openvswitch'], | 54 | 'quantum-plugin-openvswitch'], |
89 | @@ -57,7 +73,8 @@ | |||
90 | 57 | 73 | ||
91 | 58 | def neutron_plugins(): | 74 | def neutron_plugins(): |
92 | 59 | from charmhelpers.contrib.openstack import context | 75 | from charmhelpers.contrib.openstack import context |
94 | 60 | return { | 76 | release = os_release('nova-common') |
95 | 77 | plugins = { | ||
96 | 61 | 'ovs': { | 78 | 'ovs': { |
97 | 62 | 'config': '/etc/neutron/plugins/openvswitch/' | 79 | 'config': '/etc/neutron/plugins/openvswitch/' |
98 | 63 | 'ovs_neutron_plugin.ini', | 80 | 'ovs_neutron_plugin.ini', |
99 | @@ -68,8 +85,8 @@ | |||
100 | 68 | database=config('neutron-database'), | 85 | database=config('neutron-database'), |
101 | 69 | relation_prefix='neutron')], | 86 | relation_prefix='neutron')], |
102 | 70 | 'services': ['neutron-plugin-openvswitch-agent'], | 87 | 'services': ['neutron-plugin-openvswitch-agent'], |
105 | 71 | 'packages': [[headers_package(), 'openvswitch-datapath-dkms'], | 88 | 'packages': [[headers_package()] + determine_dkms_package(), |
106 | 72 | ['quantum-plugin-openvswitch-agent']], | 89 | ['neutron-plugin-openvswitch-agent']], |
107 | 73 | 'server_packages': ['neutron-server', | 90 | 'server_packages': ['neutron-server', |
108 | 74 | 'neutron-plugin-openvswitch'], | 91 | 'neutron-plugin-openvswitch'], |
109 | 75 | 'server_services': ['neutron-server'] | 92 | 'server_services': ['neutron-server'] |
110 | @@ -89,6 +106,13 @@ | |||
111 | 89 | 'server_services': ['neutron-server'] | 106 | 'server_services': ['neutron-server'] |
112 | 90 | } | 107 | } |
113 | 91 | } | 108 | } |
114 | 109 | # NOTE: patch in ml2 plugin for icehouse onwards | ||
115 | 110 | if release >= 'icehouse': | ||
116 | 111 | plugins['ovs']['config'] = '/etc/neutron/plugins/ml2/ml2_conf.ini' | ||
117 | 112 | plugins['ovs']['driver'] = 'neutron.plugins.ml2.plugin.Ml2Plugin' | ||
118 | 113 | plugins['ovs']['server_packages'] = ['neutron-server', | ||
119 | 114 | 'neutron-plugin-ml2'] | ||
120 | 115 | return plugins | ||
121 | 92 | 116 | ||
122 | 93 | 117 | ||
123 | 94 | def neutron_plugin_attribute(plugin, attr, net_manager=None): | 118 | def neutron_plugin_attribute(plugin, attr, net_manager=None): |
124 | 95 | 119 | ||
125 | === modified file 'hooks/charmhelpers/contrib/openstack/utils.py' | |||
126 | --- hooks/charmhelpers/contrib/openstack/utils.py 2014-03-14 13:24:39 +0000 | |||
127 | +++ hooks/charmhelpers/contrib/openstack/utils.py 2014-03-26 11:07:00 +0000 | |||
128 | @@ -65,6 +65,9 @@ | |||
129 | 65 | ('1.10.0', 'havana'), | 65 | ('1.10.0', 'havana'), |
130 | 66 | ('1.9.1', 'havana'), | 66 | ('1.9.1', 'havana'), |
131 | 67 | ('1.9.0', 'havana'), | 67 | ('1.9.0', 'havana'), |
132 | 68 | ('1.13.0', 'icehouse'), | ||
133 | 69 | ('1.12.0', 'icehouse'), | ||
134 | 70 | ('1.11.0', 'icehouse'), | ||
135 | 68 | ]) | 71 | ]) |
136 | 69 | 72 | ||
137 | 70 | DEFAULT_LOOPBACK_SIZE = '5G' | 73 | DEFAULT_LOOPBACK_SIZE = '5G' |
138 | @@ -420,19 +423,19 @@ | |||
139 | 420 | Resolves hostname for given IP, or returns the input | 423 | Resolves hostname for given IP, or returns the input |
140 | 421 | if it is already a hostname. | 424 | if it is already a hostname. |
141 | 422 | """ | 425 | """ |
155 | 423 | if not is_ip(address): | 426 | if is_ip(address): |
156 | 424 | return address | 427 | try: |
157 | 425 | 428 | import dns.reversename | |
158 | 426 | try: | 429 | except ImportError: |
159 | 427 | import dns.reversename | 430 | apt_install('python-dnspython') |
160 | 428 | except ImportError: | 431 | import dns.reversename |
161 | 429 | apt_install('python-dnspython') | 432 | |
162 | 430 | import dns.reversename | 433 | rev = dns.reversename.from_address(address) |
163 | 431 | 434 | result = ns_query(rev) | |
164 | 432 | rev = dns.reversename.from_address(address) | 435 | if not result: |
165 | 433 | result = ns_query(rev) | 436 | return None |
166 | 434 | if not result: | 437 | else: |
167 | 435 | return None | 438 | result = address |
168 | 436 | 439 | ||
169 | 437 | if fqdn: | 440 | if fqdn: |
170 | 438 | # strip trailing . | 441 | # strip trailing . |
171 | 439 | 442 | ||
172 | === modified file 'hooks/charmhelpers/contrib/storage/linux/utils.py' | |||
173 | --- hooks/charmhelpers/contrib/storage/linux/utils.py 2014-03-14 13:24:39 +0000 | |||
174 | +++ hooks/charmhelpers/contrib/storage/linux/utils.py 2014-03-26 11:07:00 +0000 | |||
175 | @@ -22,4 +22,5 @@ | |||
176 | 22 | 22 | ||
177 | 23 | :param block_device: str: Full path of block device to clean. | 23 | :param block_device: str: Full path of block device to clean. |
178 | 24 | ''' | 24 | ''' |
180 | 25 | check_call(['sgdisk', '--zap-all', '--mbrtogpt', block_device]) | 25 | check_call(['sgdisk', '--zap-all', '--clear', |
181 | 26 | '--mbrtogpt', block_device]) | ||
182 | 26 | 27 | ||
183 | === modified file 'hooks/charmhelpers/fetch/__init__.py' | |||
184 | --- hooks/charmhelpers/fetch/__init__.py 2014-03-14 13:24:39 +0000 | |||
185 | +++ hooks/charmhelpers/fetch/__init__.py 2014-03-26 11:07:00 +0000 | |||
186 | @@ -97,6 +97,29 @@ | |||
187 | 97 | subprocess.call(cmd, env=env) | 97 | subprocess.call(cmd, env=env) |
188 | 98 | 98 | ||
189 | 99 | 99 | ||
190 | 100 | def apt_upgrade(options=None, fatal=False, dist=False): | ||
191 | 101 | """Upgrade all packages""" | ||
192 | 102 | if options is None: | ||
193 | 103 | options = ['--option=Dpkg::Options::=--force-confold'] | ||
194 | 104 | |||
195 | 105 | cmd = ['apt-get', '--assume-yes'] | ||
196 | 106 | cmd.extend(options) | ||
197 | 107 | if dist: | ||
198 | 108 | cmd.append('dist-upgrade') | ||
199 | 109 | else: | ||
200 | 110 | cmd.append('upgrade') | ||
201 | 111 | log("Upgrading with options: {}".format(options)) | ||
202 | 112 | |||
203 | 113 | env = os.environ.copy() | ||
204 | 114 | if 'DEBIAN_FRONTEND' not in env: | ||
205 | 115 | env['DEBIAN_FRONTEND'] = 'noninteractive' | ||
206 | 116 | |||
207 | 117 | if fatal: | ||
208 | 118 | subprocess.check_call(cmd, env=env) | ||
209 | 119 | else: | ||
210 | 120 | subprocess.call(cmd, env=env) | ||
211 | 121 | |||
212 | 122 | |||
213 | 100 | def apt_update(fatal=False): | 123 | def apt_update(fatal=False): |
214 | 101 | """Update local apt cache""" | 124 | """Update local apt cache""" |
215 | 102 | cmd = ['apt-get', 'update'] | 125 | cmd = ['apt-get', 'update'] |
216 | 103 | 126 | ||
217 | === modified file 'hooks/charmhelpers/fetch/archiveurl.py' | |||
218 | --- hooks/charmhelpers/fetch/archiveurl.py 2013-09-02 16:36:50 +0000 | |||
219 | +++ hooks/charmhelpers/fetch/archiveurl.py 2014-03-26 11:07:00 +0000 | |||
220 | @@ -1,5 +1,7 @@ | |||
221 | 1 | import os | 1 | import os |
222 | 2 | import urllib2 | 2 | import urllib2 |
223 | 3 | import urlparse | ||
224 | 4 | |||
225 | 3 | from charmhelpers.fetch import ( | 5 | from charmhelpers.fetch import ( |
226 | 4 | BaseFetchHandler, | 6 | BaseFetchHandler, |
227 | 5 | UnhandledSource | 7 | UnhandledSource |
228 | @@ -24,6 +26,19 @@ | |||
229 | 24 | def download(self, source, dest): | 26 | def download(self, source, dest): |
230 | 25 | # propogate all exceptions | 27 | # propogate all exceptions |
231 | 26 | # URLError, OSError, etc | 28 | # URLError, OSError, etc |
232 | 29 | proto, netloc, path, params, query, fragment = urlparse.urlparse(source) | ||
233 | 30 | if proto in ('http', 'https'): | ||
234 | 31 | auth, barehost = urllib2.splituser(netloc) | ||
235 | 32 | if auth is not None: | ||
236 | 33 | source = urlparse.urlunparse((proto, barehost, path, params, query, fragment)) | ||
237 | 34 | username, password = urllib2.splitpasswd(auth) | ||
238 | 35 | passman = urllib2.HTTPPasswordMgrWithDefaultRealm() | ||
239 | 36 | # Realm is set to None in add_password to force the username and password | ||
240 | 37 | # to be used whatever the realm | ||
241 | 38 | passman.add_password(None, source, username, password) | ||
242 | 39 | authhandler = urllib2.HTTPBasicAuthHandler(passman) | ||
243 | 40 | opener = urllib2.build_opener(authhandler) | ||
244 | 41 | urllib2.install_opener(opener) | ||
245 | 27 | response = urllib2.urlopen(source) | 42 | response = urllib2.urlopen(source) |
246 | 28 | try: | 43 | try: |
247 | 29 | with open(dest, 'w') as dest_file: | 44 | with open(dest, 'w') as dest_file: |
248 | 30 | 45 | ||
249 | === modified file 'hooks/quantum_utils.py' | |||
250 | --- hooks/quantum_utils.py 2014-03-14 13:24:39 +0000 | |||
251 | +++ hooks/quantum_utils.py 2014-03-26 11:07:00 +0000 | |||
252 | @@ -25,6 +25,9 @@ | |||
253 | 25 | ) | 25 | ) |
254 | 26 | 26 | ||
255 | 27 | import charmhelpers.contrib.openstack.context as context | 27 | import charmhelpers.contrib.openstack.context as context |
256 | 28 | from charmhelpers.contrib.openstack.context import ( | ||
257 | 29 | SyslogContext | ||
258 | 30 | ) | ||
259 | 28 | import charmhelpers.contrib.openstack.templating as templating | 31 | import charmhelpers.contrib.openstack.templating as templating |
260 | 29 | from charmhelpers.contrib.openstack.neutron import headers_package | 32 | from charmhelpers.contrib.openstack.neutron import headers_package |
261 | 30 | from quantum_contexts import ( | 33 | from quantum_contexts import ( |
262 | @@ -150,7 +153,8 @@ | |||
263 | 150 | 'hook_contexts': [context.AMQPContext(), | 153 | 'hook_contexts': [context.AMQPContext(), |
264 | 151 | QuantumSharedDBContext(), | 154 | QuantumSharedDBContext(), |
265 | 152 | NetworkServiceContext(), | 155 | NetworkServiceContext(), |
267 | 153 | QuantumGatewayContext()], | 156 | QuantumGatewayContext(), |
268 | 157 | SyslogContext()], | ||
269 | 154 | 'services': ['nova-api-metadata'] | 158 | 'services': ['nova-api-metadata'] |
270 | 155 | }, | 159 | }, |
271 | 156 | } | 160 | } |
272 | @@ -188,7 +192,8 @@ | |||
273 | 188 | QUANTUM_OVS_CONFIG_FILES = { | 192 | QUANTUM_OVS_CONFIG_FILES = { |
274 | 189 | QUANTUM_CONF: { | 193 | QUANTUM_CONF: { |
275 | 190 | 'hook_contexts': [context.AMQPContext(), | 194 | 'hook_contexts': [context.AMQPContext(), |
277 | 191 | QuantumGatewayContext()], | 195 | QuantumGatewayContext(), |
278 | 196 | SyslogContext()], | ||
279 | 192 | 'services': ['quantum-l3-agent', | 197 | 'services': ['quantum-l3-agent', |
280 | 193 | 'quantum-dhcp-agent', | 198 | 'quantum-dhcp-agent', |
281 | 194 | 'quantum-metadata-agent', | 199 | 'quantum-metadata-agent', |
282 | @@ -214,7 +219,8 @@ | |||
283 | 214 | NEUTRON_OVS_CONFIG_FILES = { | 219 | NEUTRON_OVS_CONFIG_FILES = { |
284 | 215 | NEUTRON_CONF: { | 220 | NEUTRON_CONF: { |
285 | 216 | 'hook_contexts': [context.AMQPContext(), | 221 | 'hook_contexts': [context.AMQPContext(), |
287 | 217 | QuantumGatewayContext()], | 222 | QuantumGatewayContext(), |
288 | 223 | SyslogContext()], | ||
289 | 218 | 'services': ['neutron-l3-agent', | 224 | 'services': ['neutron-l3-agent', |
290 | 219 | 'neutron-dhcp-agent', | 225 | 'neutron-dhcp-agent', |
291 | 220 | 'neutron-metadata-agent', | 226 | 'neutron-metadata-agent', |
292 | 221 | 227 | ||
293 | === modified file 'revision' | |||
294 | --- revision 2014-03-14 13:24:39 +0000 | |||
295 | +++ revision 2014-03-26 11:07:00 +0000 | |||
296 | @@ -1,1 +1,1 @@ | |||
298 | 1 | 63 | 1 | 64 |
299 | 2 | \ No newline at end of file | 2 | \ No newline at end of file |
300 | 3 | 3 | ||
301 | === modified file 'templates/folsom/metadata_agent.ini' | |||
302 | --- templates/folsom/metadata_agent.ini 2013-09-04 09:46:54 +0000 | |||
303 | +++ templates/folsom/metadata_agent.ini 2014-03-26 11:07:00 +0000 | |||
304 | @@ -14,4 +14,4 @@ | |||
305 | 14 | # shared secret to prevent spoofing. You may select any string for a secret, | 14 | # shared secret to prevent spoofing. You may select any string for a secret, |
306 | 15 | # but it must match here and in the configuration used by the Nova Metadata | 15 | # but it must match here and in the configuration used by the Nova Metadata |
307 | 16 | # Server. NOTE: Nova uses a different key: quantum_metadata_proxy_shared_secret | 16 | # Server. NOTE: Nova uses a different key: quantum_metadata_proxy_shared_secret |
309 | 17 | metadata_proxy_shared_secret = {{ shared_secret }} | 17 | metadata_proxy_shared_secret = {{ shared_secret }} |
310 | 18 | \ No newline at end of file | 18 | \ No newline at end of file |
311 | 19 | 19 | ||
312 | === modified file 'templates/folsom/nova.conf' | |||
313 | --- templates/folsom/nova.conf 2013-09-04 09:46:54 +0000 | |||
314 | +++ templates/folsom/nova.conf 2014-03-26 11:07:00 +0000 | |||
315 | @@ -4,6 +4,7 @@ | |||
316 | 4 | lock_path=/var/lock/nova | 4 | lock_path=/var/lock/nova |
317 | 5 | root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf | 5 | root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf |
318 | 6 | verbose=True | 6 | verbose=True |
319 | 7 | use_syslog = {{ use_syslog }} | ||
320 | 7 | api_paste_config=/etc/nova/api-paste.ini | 8 | api_paste_config=/etc/nova/api-paste.ini |
321 | 8 | enabled_apis=metadata | 9 | enabled_apis=metadata |
322 | 9 | multi_host=True | 10 | multi_host=True |
323 | 10 | 11 | ||
324 | === modified file 'templates/folsom/quantum.conf' | |||
325 | --- templates/folsom/quantum.conf 2013-09-04 09:46:54 +0000 | |||
326 | +++ templates/folsom/quantum.conf 2014-03-26 11:07:00 +0000 | |||
327 | @@ -5,6 +5,7 @@ | |||
328 | 5 | rabbit_host = {{ rabbitmq_host }} | 5 | rabbit_host = {{ rabbitmq_host }} |
329 | 6 | rabbit_password = {{ rabbitmq_password }} | 6 | rabbit_password = {{ rabbitmq_password }} |
330 | 7 | debug = True | 7 | debug = True |
331 | 8 | use_syslog = {{ use_syslog }} | ||
332 | 8 | bind_host = 0.0.0.0 | 9 | bind_host = 0.0.0.0 |
333 | 9 | bind_port = 9696 | 10 | bind_port = 9696 |
334 | 10 | core_plugin = {{ core_plugin }} | 11 | core_plugin = {{ core_plugin }} |
335 | 11 | 12 | ||
336 | === modified file 'templates/havana/neutron.conf' | |||
337 | --- templates/havana/neutron.conf 2013-09-04 09:46:54 +0000 | |||
338 | +++ templates/havana/neutron.conf 2014-03-26 11:07:00 +0000 | |||
339 | @@ -5,6 +5,7 @@ | |||
340 | 5 | rabbit_host = {{ rabbitmq_host }} | 5 | rabbit_host = {{ rabbitmq_host }} |
341 | 6 | rabbit_password = {{ rabbitmq_password }} | 6 | rabbit_password = {{ rabbitmq_password }} |
342 | 7 | debug = True | 7 | debug = True |
343 | 8 | use_syslog = {{ use_syslog }} | ||
344 | 8 | bind_host = 0.0.0.0 | 9 | bind_host = 0.0.0.0 |
345 | 9 | bind_port = 9696 | 10 | bind_port = 9696 |
346 | 10 | core_plugin = {{ core_plugin }} | 11 | core_plugin = {{ core_plugin }} |
347 | 11 | 12 | ||
348 | === modified file 'templates/havana/nova.conf' | |||
349 | --- templates/havana/nova.conf 2013-09-04 09:46:54 +0000 | |||
350 | +++ templates/havana/nova.conf 2014-03-26 11:07:00 +0000 | |||
351 | @@ -4,6 +4,7 @@ | |||
352 | 4 | lock_path=/var/lock/nova | 4 | lock_path=/var/lock/nova |
353 | 5 | root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf | 5 | root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf |
354 | 6 | verbose=True | 6 | verbose=True |
355 | 7 | use_syslog = {{ use_syslog }} | ||
356 | 7 | api_paste_config=/etc/nova/api-paste.ini | 8 | api_paste_config=/etc/nova/api-paste.ini |
357 | 8 | enabled_apis=metadata | 9 | enabled_apis=metadata |
358 | 9 | multi_host=True | 10 | multi_host=True |
359 | 10 | 11 | ||
360 | === modified file 'unit_tests/test_quantum_contexts.py' | |||
361 | --- unit_tests/test_quantum_contexts.py 2014-03-14 13:24:39 +0000 | |||
362 | +++ unit_tests/test_quantum_contexts.py 2014-03-26 11:07:00 +0000 | |||
363 | @@ -1,5 +1,10 @@ | |||
365 | 1 | from mock import MagicMock, patch | 1 | from mock import ( |
366 | 2 | Mock, | ||
367 | 3 | MagicMock, | ||
368 | 4 | patch | ||
369 | 5 | ) | ||
370 | 2 | import quantum_contexts | 6 | import quantum_contexts |
371 | 7 | import sys | ||
372 | 3 | from contextlib import contextmanager | 8 | from contextlib import contextmanager |
373 | 4 | 9 | ||
374 | 5 | from test_utils import ( | 10 | from test_utils import ( |
375 | @@ -199,6 +204,7 @@ | |||
376 | 199 | def setUp(self): | 204 | def setUp(self): |
377 | 200 | super(TestQuantumGatewayContext, self).setUp(quantum_contexts, | 205 | super(TestQuantumGatewayContext, self).setUp(quantum_contexts, |
378 | 201 | TO_PATCH) | 206 | TO_PATCH) |
379 | 207 | self.config.side_effect = self.test_config.get | ||
380 | 202 | 208 | ||
381 | 203 | @patch.object(quantum_contexts, 'get_shared_secret') | 209 | @patch.object(quantum_contexts, 'get_shared_secret') |
382 | 204 | @patch.object(quantum_contexts, 'get_host_ip') | 210 | @patch.object(quantum_contexts, 'get_host_ip') |
383 | @@ -256,6 +262,19 @@ | |||
384 | 256 | super(TestHostIP, self).setUp(quantum_contexts, | 262 | super(TestHostIP, self).setUp(quantum_contexts, |
385 | 257 | TO_PATCH) | 263 | TO_PATCH) |
386 | 258 | self.config.side_effect = self.test_config.get | 264 | self.config.side_effect = self.test_config.get |
387 | 265 | # Save and inject | ||
388 | 266 | self.mods = {'dns': None, 'dns.resolver': None} | ||
389 | 267 | for mod in self.mods: | ||
390 | 268 | if mod not in sys.modules: | ||
391 | 269 | sys.modules[mod] = Mock() | ||
392 | 270 | else: | ||
393 | 271 | del self.mods[mod] | ||
394 | 272 | |||
395 | 273 | def tearDown(self): | ||
396 | 274 | super(TestHostIP, self).tearDown() | ||
397 | 275 | # Cleanup | ||
398 | 276 | for mod in self.mods.keys(): | ||
399 | 277 | del sys.modules[mod] | ||
400 | 259 | 278 | ||
401 | 260 | def test_get_host_ip_already_ip(self): | 279 | def test_get_host_ip_already_ip(self): |
402 | 261 | self.assertEquals(quantum_contexts.get_host_ip('10.5.0.1'), | 280 | self.assertEquals(quantum_contexts.get_host_ip('10.5.0.1'), |
403 | @@ -268,8 +287,7 @@ | |||
404 | 268 | 287 | ||
405 | 269 | @patch('dns.resolver.query') | 288 | @patch('dns.resolver.query') |
406 | 270 | def test_get_host_ip_hostname_unresolvable(self, _query): | 289 | def test_get_host_ip_hostname_unresolvable(self, _query): |
409 | 271 | class NXDOMAIN(Exception): | 290 | class NXDOMAIN(Exception): pass |
408 | 272 | pass | ||
410 | 273 | _query.side_effect = NXDOMAIN() | 291 | _query.side_effect = NXDOMAIN() |
411 | 274 | self.assertRaises(NXDOMAIN, quantum_contexts.get_host_ip, | 292 | self.assertRaises(NXDOMAIN, quantum_contexts.get_host_ip, |
412 | 275 | 'missing.example.com') | 293 | 'missing.example.com') |