Merge lp:~openstack-charmers/charms/trusty/neutron-api/0mq into lp:~openstack-charmers-archive/charms/trusty/neutron-api/next

Proposed by Liam Young
Status: Merged
Merged at revision: 95
Proposed branch: lp:~openstack-charmers/charms/trusty/neutron-api/0mq
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-api/next
Diff against target: 747 lines (+390/-90)
14 files modified
hooks/charmhelpers/contrib/openstack/amulet/deployment.py (+25/-2)
hooks/charmhelpers/contrib/openstack/context.py (+144/-1)
hooks/charmhelpers/contrib/openstack/templates/git.upstart (+13/-0)
hooks/charmhelpers/contrib/openstack/templates/section-zeromq (+14/-0)
hooks/charmhelpers/contrib/openstack/templates/zeromq (+0/-14)
hooks/charmhelpers/contrib/openstack/utils.py (+124/-69)
hooks/charmhelpers/core/unitdata.py (+1/-1)
hooks/neutron_api_hooks.py (+19/-1)
hooks/neutron_api_utils.py (+12/-0)
metadata.yaml (+3/-0)
templates/icehouse/neutron.conf (+4/-0)
templates/kilo/neutron.conf (+3/-0)
tests/charmhelpers/contrib/openstack/amulet/deployment.py (+25/-2)
unit_tests/test_neutron_api_hooks.py (+3/-0)
To merge this branch: bzr merge lp:~openstack-charmers/charms/trusty/neutron-api/0mq
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
James Page Needs Fixing
Review via email: mp+238881@code.launchpad.net
To post a comment you must log in.
54. By Liam Young

Fix unit tests

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.

#698 neutron-api-next for gnuoy mp238881
charm_lint_check

This build:
http://10.98.191.181:8080/job/charm_lint_check/698/

MP URL:
https://code.launchpad.net/~openstack-charmers/charms/trusty/neutron-api/0mq/+merge/238881

Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-api/0mq

Results summary:
    LINT OK: believed to pass, but you should confirm results

LINT Results (max last 25 lines) from
/var/lib/jenkins/workspace/charm_lint_check/make-lint.698:
I: config.yaml: option ssl_key has no default value
I: config.yaml: option os-admin-network has no default value
I: config.yaml: option nsx-controllers has no default value
I: config.yaml: option vip has no default value
I: config.yaml: option nsx-l3-uuid has no default value
I: config.yaml: option ssl_ca has no default value
I: config.yaml: option ssl_cert has no default value
I: config.yaml: option os-internal-network has no default value
I: config.yaml: option os-public-network has no default value
I: config.yaml: option nsx-tz-uuid has no default value

Ubuntu OSCI Jenkins is currently in development on a Canonical private network, but we plan to publish results to a public instance soon. Tests are triggered if the proposed branch rev changes, or if the MP is placed into "Needs review" status after being otherwise for >= 1hr. Human review of results is still recommended.
http://10.98.191.181:8080/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.

#504 neutron-api-next for gnuoy mp238881
charm_unit_test

This build:
http://10.98.191.181:8080/job/charm_unit_test/504/

MP URL:
https://code.launchpad.net/~openstack-charmers/charms/trusty/neutron-api/0mq/+merge/238881

Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-api/0mq

Results summary:
    UNIT OK: believed to pass, but you should confirm results

UNIT Results (max last 25 lines) from
/var/lib/jenkins/workspace/charm_unit_test/unit-test.504:
Starting tests...
.......................................................
Name Stmts Miss Cover Missing
---------------------------------------------------------
hooks/neutron_api_context 80 6 93% 22, 34-36, 78, 110
hooks/neutron_api_hooks 200 18 91% 122-123, 183-184, 197, 262, 308, 327-338, 415, 423, 427-428
hooks/neutron_api_utils 99 8 92% 219, 243-255
---------------------------------------------------------
TOTAL 379 32 92%
----------------------------------------------------------------------
Ran 55 tests in 3.385s

OK

Ubuntu OSCI Jenkins is currently in development on a Canonical private network, but we plan to publish results to a public instance soon. Tests are triggered if the proposed branch rev changes, or if the MP is placed into "Needs review" status after being otherwise for >= 1hr. Human review of results is still recommended.
http://10.98.191.181:8080/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.

#255 neutron-api-next for gnuoy mp238881
charm_amulet_test

This build:
http://10.98.191.181:8080/job/charm_amulet_test/255/

MP URL:
https://code.launchpad.net/~openstack-charmers/charms/trusty/neutron-api/0mq/+merge/238881

Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-api/0mq

Results summary:
    AMULET FAIL: amulet-test missing

AMULET Results not found.

Ubuntu OSCI Jenkins is currently in development on a Canonical private network, but we plan to publish results to a public instance soon. Tests are triggered if the proposed branch rev changes, or if the MP is placed into "Needs review" status after being otherwise for >= 1hr. Human review of results is still recommended.
http://10.98.191.181:8080/

Revision history for this message
James Page (james-page) :
review: Needs Fixing
55. By James Page

Rebase on next

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #167 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/9527363/
Build: http://10.245.162.77:8080/job/charm_lint_check/167/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #201 neutron-api-next for gnuoy mp238881
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/201/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #181 neutron-api-next for gnuoy mp238881
    AMULET FAIL: no-tear-down-replace failed
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/9527382/
Build: http://10.245.162.77:8080/job/charm_amulet_test/181/

56. By James Page

Rebase on next

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #710 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/9727332/
Build: http://10.245.162.77:8080/job/charm_lint_check/710/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #895 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/9727334/
Build: http://10.245.162.77:8080/job/charm_amulet_test/895/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #739 neutron-api-next for gnuoy mp238881
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/739/

57. By James Page

Use centralized zeromq template

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #843 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/9783631/
Build: http://10.245.162.77:8080/job/charm_lint_check/843/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #872 neutron-api-next for gnuoy mp238881
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
  FAILED (failures=1)
  make: *** [unit_test] Error 1

Full unit test output: http://paste.ubuntu.com/9783634/
Build: http://10.245.162.77:8080/job/charm_unit_test/872/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1067 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/9783642/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1067/

58. By James Page

Sortout zeromq section

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #847 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/9783952/
Build: http://10.245.162.77:8080/job/charm_lint_check/847/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #876 neutron-api-next for gnuoy mp238881
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
  FAILED (failures=1)
  make: *** [unit_test] Error 1

Full unit test output: http://paste.ubuntu.com/9783953/
Build: http://10.245.162.77:8080/job/charm_unit_test/876/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1071 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/9783956/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1071/

59. By James Page

Resync helper

60. By James Page

Resync helper

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #871 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/9793805/
Build: http://10.245.162.77:8080/job/charm_lint_check/871/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #900 neutron-api-next for gnuoy mp238881
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
  FAILED (failures=1)
  make: *** [unit_test] Error 1

Full unit test output: http://paste.ubuntu.com/9793810/
Build: http://10.245.162.77:8080/job/charm_unit_test/900/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1095 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/9793839/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1095/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #877 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/9793987/
Build: http://10.245.162.77:8080/job/charm_lint_check/877/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #906 neutron-api-next for gnuoy mp238881
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
  FAILED (failures=1)
  make: *** [unit_test] Error 1

Full unit test output: http://paste.ubuntu.com/9793989/
Build: http://10.245.162.77:8080/job/charm_unit_test/906/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1101 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/9794054/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1101/

61. By James Page

Rebase

62. By James Page

Rebase

63. By James Page

Add juno specific config files, drop icehouse zeromq support, add to kilo

64. By James Page

Drop files we don't need to specialize for juno

65. By James Page

Ensure check uses a neutron package for zeromq support

66. By James Page

Update headers for templates

67. By James Page

Reorder zeromq inclusion

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2229 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10396131/
Build: http://10.245.162.77:8080/job/charm_lint_check/2229/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #2018 neutron-api-next for gnuoy mp238881
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/2018/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2175 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

Full amulet test output: http://paste.ubuntu.com/10397170/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2175/

68. By James Page

Rebase

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2685 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10610022/
Build: http://10.245.162.77:8080/job/charm_lint_check/2685/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #2476 neutron-api-next for gnuoy mp238881
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/2476/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2514 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 124
  make: *** [test] Error 124

Full amulet test output: http://paste.ubuntu.com/10610269/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2514/

69. By James Page

Make 0mq support >= kilo

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2695 neutron-api-next for gnuoy mp238881
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_api_hooks.py:31:1: F401 'os_release' imported but unused
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10610580/
Build: http://10.245.162.77:8080/job/charm_lint_check/2695/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #2486 neutron-api-next for gnuoy mp238881
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/2486/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #2524 neutron-api-next for gnuoy mp238881
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

Full amulet test output: http://paste.ubuntu.com/10610801/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2524/

70. By James Page

Tidy lint

71. By James Page

Rebase resync

72. By James Page

Rebase

73. By James Page

Rebase

Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/charmhelpers/contrib/openstack/amulet/deployment.py'
--- hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-03-13 12:59:38 +0000
+++ hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-04-01 14:20:40 +0000
@@ -15,6 +15,7 @@
15# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.15# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
1616
17import six17import six
18from collections import OrderedDict
18from charmhelpers.contrib.amulet.deployment import (19from charmhelpers.contrib.amulet.deployment import (
19 AmuletDeployment20 AmuletDeployment
20)21)
@@ -100,12 +101,34 @@
100 """101 """
101 (self.precise_essex, self.precise_folsom, self.precise_grizzly,102 (self.precise_essex, self.precise_folsom, self.precise_grizzly,
102 self.precise_havana, self.precise_icehouse,103 self.precise_havana, self.precise_icehouse,
103 self.trusty_icehouse) = range(6)104 self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8)
104 releases = {105 releases = {
105 ('precise', None): self.precise_essex,106 ('precise', None): self.precise_essex,
106 ('precise', 'cloud:precise-folsom'): self.precise_folsom,107 ('precise', 'cloud:precise-folsom'): self.precise_folsom,
107 ('precise', 'cloud:precise-grizzly'): self.precise_grizzly,108 ('precise', 'cloud:precise-grizzly'): self.precise_grizzly,
108 ('precise', 'cloud:precise-havana'): self.precise_havana,109 ('precise', 'cloud:precise-havana'): self.precise_havana,
109 ('precise', 'cloud:precise-icehouse'): self.precise_icehouse,110 ('precise', 'cloud:precise-icehouse'): self.precise_icehouse,
110 ('trusty', None): self.trusty_icehouse}111 ('trusty', None): self.trusty_icehouse,
112 ('trusty', 'cloud:trusty-juno'): self.trusty_juno,
113 ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo}
111 return releases[(self.series, self.openstack)]114 return releases[(self.series, self.openstack)]
115
116 def _get_openstack_release_string(self):
117 """Get openstack release string.
118
119 Return a string representing the openstack release.
120 """
121 releases = OrderedDict([
122 ('precise', 'essex'),
123 ('quantal', 'folsom'),
124 ('raring', 'grizzly'),
125 ('saucy', 'havana'),
126 ('trusty', 'icehouse'),
127 ('utopic', 'juno'),
128 ('vivid', 'kilo'),
129 ])
130 if self.openstack:
131 os_origin = self.openstack.split(':')[1]
132 return os_origin.split('%s-' % self.series)[1].split('/')[0]
133 else:
134 return releases[self.series]
112135
=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
--- hooks/charmhelpers/contrib/openstack/context.py 2015-03-19 16:58:14 +0000
+++ hooks/charmhelpers/contrib/openstack/context.py 2015-04-01 14:20:40 +0000
@@ -47,6 +47,7 @@
47)47)
4848
49from charmhelpers.core.sysctl import create as sysctl_create49from charmhelpers.core.sysctl import create as sysctl_create
50from charmhelpers.core.strutils import bool_from_string
5051
51from charmhelpers.core.host import (52from charmhelpers.core.host import (
52 list_nics,53 list_nics,
@@ -67,6 +68,7 @@
67)68)
68from charmhelpers.contrib.openstack.neutron import (69from charmhelpers.contrib.openstack.neutron import (
69 neutron_plugin_attribute,70 neutron_plugin_attribute,
71 parse_data_port_mappings,
70)72)
71from charmhelpers.contrib.openstack.ip import (73from charmhelpers.contrib.openstack.ip import (
72 resolve_address,74 resolve_address,
@@ -82,7 +84,6 @@
82 is_bridge_member,84 is_bridge_member,
83)85)
84from charmhelpers.contrib.openstack.utils import get_host_ip86from charmhelpers.contrib.openstack.utils import get_host_ip
85
86CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'87CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'
87ADDRESS_TYPES = ['admin', 'internal', 'public']88ADDRESS_TYPES = ['admin', 'internal', 'public']
8889
@@ -1162,3 +1163,145 @@
1162 sysctl_create(sysctl_dict,1163 sysctl_create(sysctl_dict,
1163 '/etc/sysctl.d/50-{0}.conf'.format(charm_name()))1164 '/etc/sysctl.d/50-{0}.conf'.format(charm_name()))
1164 return {'sysctl': sysctl_dict}1165 return {'sysctl': sysctl_dict}
1166
1167
1168class NeutronAPIContext(OSContextGenerator):
1169 '''
1170 Inspects current neutron-plugin-api relation for neutron settings. Return
1171 defaults if it is not present.
1172 '''
1173 interfaces = ['neutron-plugin-api']
1174
1175 def __call__(self):
1176 self.neutron_defaults = {
1177 'l2_population': {
1178 'rel_key': 'l2-population',
1179 'default': False,
1180 },
1181 'overlay_network_type': {
1182 'rel_key': 'overlay-network-type',
1183 'default': 'gre',
1184 },
1185 'neutron_security_groups': {
1186 'rel_key': 'neutron-security-groups',
1187 'default': False,
1188 },
1189 'network_device_mtu': {
1190 'rel_key': 'network-device-mtu',
1191 'default': None,
1192 },
1193 'enable_dvr': {
1194 'rel_key': 'enable-dvr',
1195 'default': False,
1196 },
1197 'enable_l3ha': {
1198 'rel_key': 'enable-l3ha',
1199 'default': False,
1200 },
1201 }
1202 ctxt = self.get_neutron_options({})
1203 for rid in relation_ids('neutron-plugin-api'):
1204 for unit in related_units(rid):
1205 rdata = relation_get(rid=rid, unit=unit)
1206 if 'l2-population' in rdata:
1207 ctxt.update(self.get_neutron_options(rdata))
1208
1209 return ctxt
1210
1211 def get_neutron_options(self, rdata):
1212 settings = {}
1213 for nkey in self.neutron_defaults.keys():
1214 defv = self.neutron_defaults[nkey]['default']
1215 rkey = self.neutron_defaults[nkey]['rel_key']
1216 if rkey in rdata.keys():
1217 if type(defv) is bool:
1218 settings[nkey] = bool_from_string(rdata[rkey])
1219 else:
1220 settings[nkey] = rdata[rkey]
1221 else:
1222 settings[nkey] = defv
1223 return settings
1224
1225
1226class ExternalPortContext(NeutronPortContext):
1227
1228 def __call__(self):
1229 ctxt = {}
1230 ports = config('ext-port')
1231 if ports:
1232 ports = [p.strip() for p in ports.split()]
1233 ports = self.resolve_ports(ports)
1234 if ports:
1235 ctxt = {"ext_port": ports[0]}
1236 napi_settings = NeutronAPIContext()()
1237 mtu = napi_settings.get('network_device_mtu')
1238 if mtu:
1239 ctxt['ext_port_mtu'] = mtu
1240
1241 return ctxt
1242
1243
1244class DataPortContext(NeutronPortContext):
1245
1246 def __call__(self):
1247 ports = config('data-port')
1248 if ports:
1249 portmap = parse_data_port_mappings(ports)
1250 ports = portmap.values()
1251 resolved = self.resolve_ports(ports)
1252 normalized = {get_nic_hwaddr(port): port for port in resolved
1253 if port not in ports}
1254 normalized.update({port: port for port in resolved
1255 if port in ports})
1256 if resolved:
1257 return {bridge: normalized[port] for bridge, port in
1258 six.iteritems(portmap) if port in normalized.keys()}
1259
1260 return None
1261
1262
1263class PhyNICMTUContext(DataPortContext):
1264
1265 def __call__(self):
1266 ctxt = {}
1267 mappings = super(PhyNICMTUContext, self).__call__()
1268 if mappings and mappings.values():
1269 ports = mappings.values()
1270 napi_settings = NeutronAPIContext()()
1271 mtu = napi_settings.get('network_device_mtu')
1272 if mtu:
1273 ctxt["devs"] = '\\n'.join(ports)
1274 ctxt['mtu'] = mtu
1275
1276 return ctxt
1277
1278
1279class NetworkServiceContext(OSContextGenerator):
1280
1281 def __init__(self, rel_name='quantum-network-service'):
1282 self.rel_name = rel_name
1283 self.interfaces = [rel_name]
1284
1285 def __call__(self):
1286 for rid in relation_ids(self.rel_name):
1287 for unit in related_units(rid):
1288 rdata = relation_get(rid=rid, unit=unit)
1289 ctxt = {
1290 'keystone_host': rdata.get('keystone_host'),
1291 'service_port': rdata.get('service_port'),
1292 'auth_port': rdata.get('auth_port'),
1293 'service_tenant': rdata.get('service_tenant'),
1294 'service_username': rdata.get('service_username'),
1295 'service_password': rdata.get('service_password'),
1296 'quantum_host': rdata.get('quantum_host'),
1297 'quantum_port': rdata.get('quantum_port'),
1298 'quantum_url': rdata.get('quantum_url'),
1299 'region': rdata.get('region'),
1300 'service_protocol':
1301 rdata.get('service_protocol') or 'http',
1302 'auth_protocol':
1303 rdata.get('auth_protocol') or 'http',
1304 }
1305 if context_complete(ctxt):
1306 return ctxt
1307 return {}
11651308
=== added file 'hooks/charmhelpers/contrib/openstack/templates/git.upstart'
--- hooks/charmhelpers/contrib/openstack/templates/git.upstart 1970-01-01 00:00:00 +0000
+++ hooks/charmhelpers/contrib/openstack/templates/git.upstart 2015-04-01 14:20:40 +0000
@@ -0,0 +1,13 @@
1description "{{ service_description }}"
2author "Juju {{ service_name }} Charm <juju@localhost>"
3
4start on runlevel [2345]
5stop on runlevel [!2345]
6
7respawn
8
9exec start-stop-daemon --start --chuid {{ user_name }} \
10 --chdir {{ start_dir }} --name {{ process_name }} \
11 --exec {{ executable_name }} -- \
12 --config-file={{ config_file }} \
13 --log-file={{ log_file }}
014
=== added file 'hooks/charmhelpers/contrib/openstack/templates/section-zeromq'
--- hooks/charmhelpers/contrib/openstack/templates/section-zeromq 1970-01-01 00:00:00 +0000
+++ hooks/charmhelpers/contrib/openstack/templates/section-zeromq 2015-04-01 14:20:40 +0000
@@ -0,0 +1,14 @@
1{% if zmq_host -%}
2# ZeroMQ configuration (restart-nonce: {{ zmq_nonce }})
3rpc_backend = zmq
4rpc_zmq_host = {{ zmq_host }}
5{% if zmq_redis_address -%}
6rpc_zmq_matchmaker = redis
7matchmaker_heartbeat_freq = 15
8matchmaker_heartbeat_ttl = 30
9[matchmaker_redis]
10host = {{ zmq_redis_address }}
11{% else -%}
12rpc_zmq_matchmaker = ring
13{% endif -%}
14{% endif -%}
015
=== removed file 'hooks/charmhelpers/contrib/openstack/templates/zeromq'
--- hooks/charmhelpers/contrib/openstack/templates/zeromq 2015-02-26 04:21:30 +0000
+++ hooks/charmhelpers/contrib/openstack/templates/zeromq 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1{% if zmq_host -%}
2# ZeroMQ configuration (restart-nonce: {{ zmq_nonce }})
3rpc_backend = zmq
4rpc_zmq_host = {{ zmq_host }}
5{% if zmq_redis_address -%}
6rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_redis.MatchMakerRedis
7matchmaker_heartbeat_freq = 15
8matchmaker_heartbeat_ttl = 30
9[matchmaker_redis]
10host = {{ zmq_redis_address }}
11{% else -%}
12rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_ring.MatchMakerRing
13{% endif -%}
14{% endif -%}
150
=== modified file 'hooks/charmhelpers/contrib/openstack/utils.py'
--- hooks/charmhelpers/contrib/openstack/utils.py 2015-03-13 12:59:38 +0000
+++ hooks/charmhelpers/contrib/openstack/utils.py 2015-04-01 14:20:40 +0000
@@ -30,6 +30,10 @@
3030
31from charmhelpers.contrib.network import ip31from charmhelpers.contrib.network import ip
3232
33from charmhelpers.core import (
34 unitdata,
35)
36
33from charmhelpers.core.hookenv import (37from charmhelpers.core.hookenv import (
34 config,38 config,
35 log as juju_log,39 log as juju_log,
@@ -330,6 +334,21 @@
330 error_out("Invalid openstack-release specified: %s" % rel)334 error_out("Invalid openstack-release specified: %s" % rel)
331335
332336
337def config_value_changed(option):
338 """
339 Determine if config value changed since last call to this function.
340 """
341 hook_data = unitdata.HookData()
342 with hook_data():
343 db = unitdata.kv()
344 current = config(option)
345 saved = db.get(option)
346 db.set(option, current)
347 if saved is None:
348 return False
349 return current != saved
350
351
333def save_script_rc(script_path="scripts/scriptrc", **env_vars):352def save_script_rc(script_path="scripts/scriptrc", **env_vars):
334 """353 """
335 Write an rc file in the charm-delivered directory containing354 Write an rc file in the charm-delivered directory containing
@@ -469,82 +488,95 @@
469488
470489
471def git_install_requested():490def git_install_requested():
472 """Returns true if openstack-origin-git is specified."""491 """
473 return config('openstack-origin-git') != "None"492 Returns true if openstack-origin-git is specified.
493 """
494 return config('openstack-origin-git') is not None
474495
475496
476requirements_dir = None497requirements_dir = None
477498
478499
479def git_clone_and_install(file_name, core_project):500def git_clone_and_install(projects_yaml, core_project):
480 """Clone/install all OpenStack repos specified in yaml config file."""501 """
502 Clone/install all specified OpenStack repositories.
503
504 The expected format of projects_yaml is:
505 repositories:
506 - {name: keystone,
507 repository: 'git://git.openstack.org/openstack/keystone.git',
508 branch: 'stable/icehouse'}
509 - {name: requirements,
510 repository: 'git://git.openstack.org/openstack/requirements.git',
511 branch: 'stable/icehouse'}
512 directory: /mnt/openstack-git
513
514 The directory key is optional.
515 """
481 global requirements_dir516 global requirements_dir
517 parent_dir = '/mnt/openstack-git'
482518
483 if file_name == "None":519 if not projects_yaml:
484 return520 return
485521
486 yaml_file = os.path.join(charm_dir(), file_name)522 projects = yaml.load(projects_yaml)
487523 _git_validate_projects_yaml(projects, core_project)
488 # clone/install the requirements project first524
489 installed = _git_clone_and_install_subset(yaml_file,525 if 'directory' in projects.keys():
490 whitelist=['requirements'])526 parent_dir = projects['directory']
491 if 'requirements' not in installed:527
492 error_out('requirements git repository must be specified')528 for p in projects['repositories']:
493529 repo = p['repository']
494 # clone/install all other projects except requirements and the core project530 branch = p['branch']
495 blacklist = ['requirements', core_project]531 if p['name'] == 'requirements':
496 _git_clone_and_install_subset(yaml_file, blacklist=blacklist,532 repo_dir = _git_clone_and_install_single(repo, branch, parent_dir,
497 update_requirements=True)533 update_requirements=False)
498534 requirements_dir = repo_dir
499 # clone/install the core project535 else:
500 whitelist = [core_project]536 repo_dir = _git_clone_and_install_single(repo, branch, parent_dir,
501 installed = _git_clone_and_install_subset(yaml_file, whitelist=whitelist,537 update_requirements=True)
502 update_requirements=True)538
503 if core_project not in installed:539
504 error_out('{} git repository must be specified'.format(core_project))540def _git_validate_projects_yaml(projects, core_project):
505541 """
506542 Validate the projects yaml.
507def _git_clone_and_install_subset(yaml_file, whitelist=[], blacklist=[],543 """
508 update_requirements=False):544 _git_ensure_key_exists('repositories', projects)
509 """Clone/install subset of OpenStack repos specified in yaml config file."""545
510 global requirements_dir546 for project in projects['repositories']:
511 installed = []547 _git_ensure_key_exists('name', project.keys())
512548 _git_ensure_key_exists('repository', project.keys())
513 with open(yaml_file, 'r') as fd:549 _git_ensure_key_exists('branch', project.keys())
514 projects = yaml.load(fd)550
515 for proj, val in projects.items():551 if projects['repositories'][0]['name'] != 'requirements':
516 # The project subset is chosen based on the following 3 rules:552 error_out('{} git repo must be specified first'.format('requirements'))
517 # 1) If project is in blacklist, we don't clone/install it, period.553
518 # 2) If whitelist is empty, we clone/install everything else.554 if projects['repositories'][-1]['name'] != core_project:
519 # 3) If whitelist is not empty, we clone/install everything in the555 error_out('{} git repo must be specified last'.format(core_project))
520 # whitelist.556
521 if proj in blacklist:557
522 continue558def _git_ensure_key_exists(key, keys):
523 if whitelist and proj not in whitelist:559 """
524 continue560 Ensure that key exists in keys.
525 repo = val['repository']561 """
526 branch = val['branch']562 if key not in keys:
527 repo_dir = _git_clone_and_install_single(repo, branch,563 error_out('openstack-origin-git key \'{}\' is missing'.format(key))
528 update_requirements)564
529 if proj == 'requirements':565
530 requirements_dir = repo_dir566def _git_clone_and_install_single(repo, branch, parent_dir, update_requirements):
531 installed.append(proj)567 """
532 return installed568 Clone and install a single git repository.
533569 """
534570 dest_dir = os.path.join(parent_dir, os.path.basename(repo))
535def _git_clone_and_install_single(repo, branch, update_requirements=False):571
536 """Clone and install a single git repository."""572 if not os.path.exists(parent_dir):
537 dest_parent_dir = "/mnt/openstack-git/"573 juju_log('Directory already exists at {}. '
538 dest_dir = os.path.join(dest_parent_dir, os.path.basename(repo))574 'No need to create directory.'.format(parent_dir))
539575 os.mkdir(parent_dir)
540 if not os.path.exists(dest_parent_dir):
541 juju_log('Host dir not mounted at {}. '
542 'Creating directory there instead.'.format(dest_parent_dir))
543 os.mkdir(dest_parent_dir)
544576
545 if not os.path.exists(dest_dir):577 if not os.path.exists(dest_dir):
546 juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch))578 juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch))
547 repo_dir = install_remote(repo, dest=dest_parent_dir, branch=branch)579 repo_dir = install_remote(repo, dest=parent_dir, branch=branch)
548 else:580 else:
549 repo_dir = dest_dir581 repo_dir = dest_dir
550582
@@ -561,16 +593,39 @@
561593
562594
563def _git_update_requirements(package_dir, reqs_dir):595def _git_update_requirements(package_dir, reqs_dir):
564 """Update from global requirements.596 """
597 Update from global requirements.
565598
566 Update an OpenStack git directory's requirements.txt and599 Update an OpenStack git directory's requirements.txt and
567 test-requirements.txt from global-requirements.txt."""600 test-requirements.txt from global-requirements.txt.
601 """
568 orig_dir = os.getcwd()602 orig_dir = os.getcwd()
569 os.chdir(reqs_dir)603 os.chdir(reqs_dir)
570 cmd = "python update.py {}".format(package_dir)604 cmd = ['python', 'update.py', package_dir]
571 try:605 try:
572 subprocess.check_call(cmd.split(' '))606 subprocess.check_call(cmd)
573 except subprocess.CalledProcessError:607 except subprocess.CalledProcessError:
574 package = os.path.basename(package_dir)608 package = os.path.basename(package_dir)
575 error_out("Error updating {} from global-requirements.txt".format(package))609 error_out("Error updating {} from global-requirements.txt".format(package))
576 os.chdir(orig_dir)610 os.chdir(orig_dir)
611
612
613def git_src_dir(projects_yaml, project):
614 """
615 Return the directory where the specified project's source is located.
616 """
617 parent_dir = '/mnt/openstack-git'
618
619 if not projects_yaml:
620 return
621
622 projects = yaml.load(projects_yaml)
623
624 if 'directory' in projects.keys():
625 parent_dir = projects['directory']
626
627 for p in projects['repositories']:
628 if p['name'] == project:
629 return os.path.join(parent_dir, os.path.basename(p['repository']))
630
631 return None
577632
=== modified file 'hooks/charmhelpers/core/unitdata.py'
--- hooks/charmhelpers/core/unitdata.py 2015-02-19 04:20:01 +0000
+++ hooks/charmhelpers/core/unitdata.py 2015-04-01 14:20:40 +0000
@@ -443,7 +443,7 @@
443 data = hookenv.execution_environment()443 data = hookenv.execution_environment()
444 self.conf = conf_delta = self.kv.delta(data['conf'], 'config')444 self.conf = conf_delta = self.kv.delta(data['conf'], 'config')
445 self.rels = rels_delta = self.kv.delta(data['rels'], 'rels')445 self.rels = rels_delta = self.kv.delta(data['rels'], 'rels')
446 self.kv.set('env', data['env'])446 self.kv.set('env', dict(data['env']))
447 self.kv.set('unit', data['unit'])447 self.kv.set('unit', data['unit'])
448 self.kv.set('relid', data.get('relid'))448 self.kv.set('relid', data.get('relid'))
449 return conf_delta, rels_delta449 return conf_delta, rels_delta
450450
=== modified file 'hooks/neutron_api_hooks.py'
--- hooks/neutron_api_hooks.py 2015-04-01 11:26:15 +0000
+++ hooks/neutron_api_hooks.py 2015-04-01 14:20:40 +0000
@@ -34,6 +34,7 @@
34from charmhelpers.contrib.openstack.utils import (34from charmhelpers.contrib.openstack.utils import (
35 configure_installation_source,35 configure_installation_source,
36 openstack_upgrade_available,36 openstack_upgrade_available,
37 os_requires_version,
37 sync_db_with_multi_ipv6_addresses38 sync_db_with_multi_ipv6_addresses
38)39)
3940
@@ -48,7 +49,8 @@
48 register_configs,49 register_configs,
49 restart_map,50 restart_map,
50 services,51 services,
51 setup_ipv652 setup_ipv6,
53 get_topics,
52)54)
53from neutron_api_context import (55from neutron_api_context import (
54 get_dvr,56 get_dvr,
@@ -154,6 +156,8 @@
154 amqp_joined(relation_id=r_id)156 amqp_joined(relation_id=r_id)
155 for r_id in relation_ids('identity-service'):157 for r_id in relation_ids('identity-service'):
156 identity_joined(rid=r_id)158 identity_joined(rid=r_id)
159 for rid in relation_ids('zeromq-configuration'):
160 zeromq_configuration_relation_joined(rid)
157 [cluster_joined(rid) for rid in relation_ids('cluster')]161 [cluster_joined(rid) for rid in relation_ids('cluster')]
158162
159163
@@ -424,6 +428,20 @@
424 neutron_api_relation_joined(rid=rid)428 neutron_api_relation_joined(rid=rid)
425429
426430
431@hooks.hook('zeromq-configuration-relation-joined')
432@os_requires_version('kilo', 'neutron-server')
433def zeromq_configuration_relation_joined(relid=None):
434 relation_set(relation_id=relid,
435 topics=" ".join(get_topics()),
436 users="neutron")
437
438
439@hooks.hook('zeromq-configuration-relation-changed')
440@restart_on_change(restart_map(), stopstart=True)
441def zeromq_configuration_relation_changed():
442 CONFIGS.write_all()
443
444
427@hooks.hook('nrpe-external-master-relation-joined',445@hooks.hook('nrpe-external-master-relation-joined',
428 'nrpe-external-master-relation-changed')446 'nrpe-external-master-relation-changed')
429def update_nrpe_config():447def update_nrpe_config():
430448
=== modified file 'hooks/neutron_api_utils.py'
--- hooks/neutron_api_utils.py 2015-03-31 07:53:39 +0000
+++ hooks/neutron_api_utils.py 2015-04-01 14:20:40 +0000
@@ -83,6 +83,8 @@
83 service_user='neutron'),83 service_user='neutron'),
84 neutron_api_context.NeutronCCContext(),84 neutron_api_context.NeutronCCContext(),
85 context.SyslogContext(),85 context.SyslogContext(),
86 context.ZeroMQContext(),
87 context.NotificationDriverContext(),
86 context.BindHostContext(),88 context.BindHostContext(),
87 context.WorkerConfigContext()],89 context.WorkerConfigContext()],
88 }),90 }),
@@ -231,6 +233,16 @@
231 configs.set_release(openstack_release=new_os_rel)233 configs.set_release(openstack_release=new_os_rel)
232234
233235
236def get_topics():
237 return ['q-l3-plugin',
238 'q-firewall-plugin',
239 'n-lbaas-plugin',
240 'ipsec_driver',
241 'q-metering-plugin',
242 'q-plugin',
243 'neutron']
244
245
234def setup_ipv6():246def setup_ipv6():
235 ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower()247 ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower()
236 if ubuntu_rel < "trusty":248 if ubuntu_rel < "trusty":
237249
=== added symlink 'hooks/zeromq-configuration-relation-changed'
=== target is u'neutron_api_hooks.py'
=== added symlink 'hooks/zeromq-configuration-relation-joined'
=== target is u'neutron_api_hooks.py'
=== modified file 'metadata.yaml'
--- metadata.yaml 2014-10-30 03:30:36 +0000
+++ metadata.yaml 2015-04-01 14:20:40 +0000
@@ -34,6 +34,9 @@
34 ha:34 ha:
35 interface: hacluster35 interface: hacluster
36 scope: container36 scope: container
37 zeromq-configuration:
38 interface: zeromq-configuration
39 scope: container
37peers:40peers:
38 cluster:41 cluster:
39 interface: neutron-api-ha42 interface: neutron-api-ha
4043
=== modified file 'templates/icehouse/neutron.conf'
--- templates/icehouse/neutron.conf 2015-03-13 12:59:38 +0000
+++ templates/icehouse/neutron.conf 2015-04-01 14:20:40 +0000
@@ -1,3 +1,4 @@
1# icehouse
1###############################################################################2###############################################################################
2# [ WARNING ]3# [ WARNING ]
3# Configuration file maintained by Juju. Local changes may be overwritten.4# Configuration file maintained by Juju. Local changes may be overwritten.
@@ -11,7 +12,10 @@
11lock_path = $state_path/lock12lock_path = $state_path/lock
12bind_host = {{ bind_host }}13bind_host = {{ bind_host }}
13auth_strategy = keystone14auth_strategy = keystone
15
16{% if notifications == 'True' -%}
14notification_driver = neutron.openstack.common.notifier.rpc_notifier17notification_driver = neutron.openstack.common.notifier.rpc_notifier
18{% endif -%}
15api_workers = {{ workers }}19api_workers = {{ workers }}
16rpc_workers = {{ workers }}20rpc_workers = {{ workers }}
1721
1822
=== modified file 'templates/kilo/neutron.conf'
--- templates/kilo/neutron.conf 2015-03-31 07:53:39 +0000
+++ templates/kilo/neutron.conf 2015-04-01 14:20:40 +0000
@@ -1,3 +1,4 @@
1# kilo
1###############################################################################2###############################################################################
2# [ WARNING ]3# [ WARNING ]
3# Configuration file maintained by Juju. Local changes may be overwritten.4# Configuration file maintained by Juju. Local changes may be overwritten.
@@ -51,6 +52,8 @@
51nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.052nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.0
52{% endif -%}53{% endif -%}
5354
55{% include "section-zeromq" %}
56
54[quotas]57[quotas]
55quota_driver = neutron.db.quota_db.DbQuotaDriver58quota_driver = neutron.db.quota_db.DbQuotaDriver
56{% if neutron_security_groups -%}59{% if neutron_security_groups -%}
5760
=== modified file 'tests/charmhelpers/contrib/openstack/amulet/deployment.py'
--- tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-02-17 07:10:15 +0000
+++ tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-04-01 14:20:40 +0000
@@ -15,6 +15,7 @@
15# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.15# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
1616
17import six17import six
18from collections import OrderedDict
18from charmhelpers.contrib.amulet.deployment import (19from charmhelpers.contrib.amulet.deployment import (
19 AmuletDeployment20 AmuletDeployment
20)21)
@@ -100,12 +101,34 @@
100 """101 """
101 (self.precise_essex, self.precise_folsom, self.precise_grizzly,102 (self.precise_essex, self.precise_folsom, self.precise_grizzly,
102 self.precise_havana, self.precise_icehouse,103 self.precise_havana, self.precise_icehouse,
103 self.trusty_icehouse) = range(6)104 self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8)
104 releases = {105 releases = {
105 ('precise', None): self.precise_essex,106 ('precise', None): self.precise_essex,
106 ('precise', 'cloud:precise-folsom'): self.precise_folsom,107 ('precise', 'cloud:precise-folsom'): self.precise_folsom,
107 ('precise', 'cloud:precise-grizzly'): self.precise_grizzly,108 ('precise', 'cloud:precise-grizzly'): self.precise_grizzly,
108 ('precise', 'cloud:precise-havana'): self.precise_havana,109 ('precise', 'cloud:precise-havana'): self.precise_havana,
109 ('precise', 'cloud:precise-icehouse'): self.precise_icehouse,110 ('precise', 'cloud:precise-icehouse'): self.precise_icehouse,
110 ('trusty', None): self.trusty_icehouse}111 ('trusty', None): self.trusty_icehouse,
112 ('trusty', 'cloud:trusty-juno'): self.trusty_juno,
113 ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo}
111 return releases[(self.series, self.openstack)]114 return releases[(self.series, self.openstack)]
115
116 def _get_openstack_release_string(self):
117 """Get openstack release string.
118
119 Return a string representing the openstack release.
120 """
121 releases = OrderedDict([
122 ('precise', 'essex'),
123 ('quantal', 'folsom'),
124 ('raring', 'grizzly'),
125 ('saucy', 'havana'),
126 ('trusty', 'icehouse'),
127 ('utopic', 'juno'),
128 ('vivid', 'kilo'),
129 ])
130 if self.openstack:
131 os_origin = self.openstack.split(':')[1]
132 return os_origin.split('%s-' % self.series)[1].split('/')[0]
133 else:
134 return releases[self.series]
112135
=== modified file 'unit_tests/test_neutron_api_hooks.py'
--- unit_tests/test_neutron_api_hooks.py 2015-04-01 11:26:15 +0000
+++ unit_tests/test_neutron_api_hooks.py 2015-04-01 14:20:40 +0000
@@ -44,6 +44,7 @@
44 'log',44 'log',
45 'open_port',45 'open_port',
46 'openstack_upgrade_available',46 'openstack_upgrade_available',
47 'os_requires_version',
47 'relation_get',48 'relation_get',
48 'relation_ids',49 'relation_ids',
49 'relation_set',50 'relation_set',
@@ -117,12 +118,14 @@
117 _amqp_rel_joined = self.patch('amqp_joined')118 _amqp_rel_joined = self.patch('amqp_joined')
118 _id_rel_joined = self.patch('identity_joined')119 _id_rel_joined = self.patch('identity_joined')
119 _id_cluster_joined = self.patch('cluster_joined')120 _id_cluster_joined = self.patch('cluster_joined')
121 _zmq_joined = self.patch('zeromq_configuration_relation_joined')
120 self._call_hook('config-changed')122 self._call_hook('config-changed')
121 self.assertTrue(_n_api_rel_joined.called)123 self.assertTrue(_n_api_rel_joined.called)
122 self.assertTrue(_n_plugin_api_rel_joined.called)124 self.assertTrue(_n_plugin_api_rel_joined.called)
123 self.assertTrue(_amqp_rel_joined.called)125 self.assertTrue(_amqp_rel_joined.called)
124 self.assertTrue(_id_rel_joined.called)126 self.assertTrue(_id_rel_joined.called)
125 self.assertTrue(_id_cluster_joined.called)127 self.assertTrue(_id_cluster_joined.called)
128 self.assertTrue(_zmq_joined.called)
126 self.assertTrue(self.CONFIGS.write_all.called)129 self.assertTrue(self.CONFIGS.write_all.called)
127 self.assertTrue(self.do_openstack_upgrade.called)130 self.assertTrue(self.do_openstack_upgrade.called)
128 self.assertTrue(self.apt_install.called)131 self.assertTrue(self.apt_install.called)

Subscribers

People subscribed via source and target branches