Merge lp:~openstack-charmers/charms/trusty/neutron-api/0mq into lp:~openstack-charmers-archive/charms/trusty/neutron-api/next
- Trusty Tahr (14.04)
- 0mq
- Merge into next
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Liam Young (community) | Approve | ||
James Page | Needs Fixing | ||
Review via email:
|
Commit message
Description of the change
- 54. By Liam Young
-
Fix unit tests
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ryan Beisner (1chb1n) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
MP URL:
https:/
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/
Starting tests...
.......
Name Stmts Miss Cover Missing
-------
hooks/neutron_
hooks/neutron_
hooks/neutron_
-------
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://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
MP URL:
https:/
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://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
James Page (james-page) : | # |
- 55. By James Page
-
Rebase on next
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #201 neutron-api-next for gnuoy mp238881
UNIT OK: passed
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #181 neutron-api-next for gnuoy mp238881
AMULET FAIL: no-tear-
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://
Build: http://
- 56. By James Page
-
Rebase on next
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #739 neutron-api-next for gnuoy mp238881
UNIT OK: passed
- 57. By James Page
-
Use centralized zeromq template
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
- 58. By James Page
-
Sortout zeromq section
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
- 59. By James Page
-
Resync helper
- 60. By James Page
-
Resync helper
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
- 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
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #2018 neutron-api-next for gnuoy mp238881
UNIT OK: passed
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
- 68. By James Page
-
Rebase
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #2476 neutron-api-next for gnuoy mp238881
UNIT OK: passed
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
- 69. By James Page
-
Make 0mq support >= kilo
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/
make: *** [lint] Error 1
Full lint test output: http://
Build: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #2486 neutron-api-next for gnuoy mp238881
UNIT OK: passed
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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://
Build: http://
- 70. By James Page
-
Tidy lint
- 71. By James Page
-
Rebase resync
- 72. By James Page
-
Rebase
- 73. By James Page
-
Rebase
Preview Diff
1 | === modified file 'hooks/charmhelpers/contrib/openstack/amulet/deployment.py' | |||
2 | --- hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-03-13 12:59:38 +0000 | |||
3 | +++ hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-04-01 14:20:40 +0000 | |||
4 | @@ -15,6 +15,7 @@ | |||
5 | 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/>. |
6 | 16 | 16 | ||
7 | 17 | import six | 17 | import six |
8 | 18 | from collections import OrderedDict | ||
9 | 18 | from charmhelpers.contrib.amulet.deployment import ( | 19 | from charmhelpers.contrib.amulet.deployment import ( |
10 | 19 | AmuletDeployment | 20 | AmuletDeployment |
11 | 20 | ) | 21 | ) |
12 | @@ -100,12 +101,34 @@ | |||
13 | 100 | """ | 101 | """ |
14 | 101 | (self.precise_essex, self.precise_folsom, self.precise_grizzly, | 102 | (self.precise_essex, self.precise_folsom, self.precise_grizzly, |
15 | 102 | self.precise_havana, self.precise_icehouse, | 103 | self.precise_havana, self.precise_icehouse, |
17 | 103 | self.trusty_icehouse) = range(6) | 104 | self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8) |
18 | 104 | releases = { | 105 | releases = { |
19 | 105 | ('precise', None): self.precise_essex, | 106 | ('precise', None): self.precise_essex, |
20 | 106 | ('precise', 'cloud:precise-folsom'): self.precise_folsom, | 107 | ('precise', 'cloud:precise-folsom'): self.precise_folsom, |
21 | 107 | ('precise', 'cloud:precise-grizzly'): self.precise_grizzly, | 108 | ('precise', 'cloud:precise-grizzly'): self.precise_grizzly, |
22 | 108 | ('precise', 'cloud:precise-havana'): self.precise_havana, | 109 | ('precise', 'cloud:precise-havana'): self.precise_havana, |
23 | 109 | ('precise', 'cloud:precise-icehouse'): self.precise_icehouse, | 110 | ('precise', 'cloud:precise-icehouse'): self.precise_icehouse, |
25 | 110 | ('trusty', None): self.trusty_icehouse} | 111 | ('trusty', None): self.trusty_icehouse, |
26 | 112 | ('trusty', 'cloud:trusty-juno'): self.trusty_juno, | ||
27 | 113 | ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo} | ||
28 | 111 | return releases[(self.series, self.openstack)] | 114 | return releases[(self.series, self.openstack)] |
29 | 115 | |||
30 | 116 | def _get_openstack_release_string(self): | ||
31 | 117 | """Get openstack release string. | ||
32 | 118 | |||
33 | 119 | Return a string representing the openstack release. | ||
34 | 120 | """ | ||
35 | 121 | releases = OrderedDict([ | ||
36 | 122 | ('precise', 'essex'), | ||
37 | 123 | ('quantal', 'folsom'), | ||
38 | 124 | ('raring', 'grizzly'), | ||
39 | 125 | ('saucy', 'havana'), | ||
40 | 126 | ('trusty', 'icehouse'), | ||
41 | 127 | ('utopic', 'juno'), | ||
42 | 128 | ('vivid', 'kilo'), | ||
43 | 129 | ]) | ||
44 | 130 | if self.openstack: | ||
45 | 131 | os_origin = self.openstack.split(':')[1] | ||
46 | 132 | return os_origin.split('%s-' % self.series)[1].split('/')[0] | ||
47 | 133 | else: | ||
48 | 134 | return releases[self.series] | ||
49 | 112 | 135 | ||
50 | === modified file 'hooks/charmhelpers/contrib/openstack/context.py' | |||
51 | --- hooks/charmhelpers/contrib/openstack/context.py 2015-03-19 16:58:14 +0000 | |||
52 | +++ hooks/charmhelpers/contrib/openstack/context.py 2015-04-01 14:20:40 +0000 | |||
53 | @@ -47,6 +47,7 @@ | |||
54 | 47 | ) | 47 | ) |
55 | 48 | 48 | ||
56 | 49 | from charmhelpers.core.sysctl import create as sysctl_create | 49 | from charmhelpers.core.sysctl import create as sysctl_create |
57 | 50 | from charmhelpers.core.strutils import bool_from_string | ||
58 | 50 | 51 | ||
59 | 51 | from charmhelpers.core.host import ( | 52 | from charmhelpers.core.host import ( |
60 | 52 | list_nics, | 53 | list_nics, |
61 | @@ -67,6 +68,7 @@ | |||
62 | 67 | ) | 68 | ) |
63 | 68 | from charmhelpers.contrib.openstack.neutron import ( | 69 | from charmhelpers.contrib.openstack.neutron import ( |
64 | 69 | neutron_plugin_attribute, | 70 | neutron_plugin_attribute, |
65 | 71 | parse_data_port_mappings, | ||
66 | 70 | ) | 72 | ) |
67 | 71 | from charmhelpers.contrib.openstack.ip import ( | 73 | from charmhelpers.contrib.openstack.ip import ( |
68 | 72 | resolve_address, | 74 | resolve_address, |
69 | @@ -82,7 +84,6 @@ | |||
70 | 82 | is_bridge_member, | 84 | is_bridge_member, |
71 | 83 | ) | 85 | ) |
72 | 84 | from charmhelpers.contrib.openstack.utils import get_host_ip | 86 | from charmhelpers.contrib.openstack.utils import get_host_ip |
73 | 85 | |||
74 | 86 | CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt' | 87 | CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt' |
75 | 87 | ADDRESS_TYPES = ['admin', 'internal', 'public'] | 88 | ADDRESS_TYPES = ['admin', 'internal', 'public'] |
76 | 88 | 89 | ||
77 | @@ -1162,3 +1163,145 @@ | |||
78 | 1162 | sysctl_create(sysctl_dict, | 1163 | sysctl_create(sysctl_dict, |
79 | 1163 | '/etc/sysctl.d/50-{0}.conf'.format(charm_name())) | 1164 | '/etc/sysctl.d/50-{0}.conf'.format(charm_name())) |
80 | 1164 | return {'sysctl': sysctl_dict} | 1165 | return {'sysctl': sysctl_dict} |
81 | 1166 | |||
82 | 1167 | |||
83 | 1168 | class NeutronAPIContext(OSContextGenerator): | ||
84 | 1169 | ''' | ||
85 | 1170 | Inspects current neutron-plugin-api relation for neutron settings. Return | ||
86 | 1171 | defaults if it is not present. | ||
87 | 1172 | ''' | ||
88 | 1173 | interfaces = ['neutron-plugin-api'] | ||
89 | 1174 | |||
90 | 1175 | def __call__(self): | ||
91 | 1176 | self.neutron_defaults = { | ||
92 | 1177 | 'l2_population': { | ||
93 | 1178 | 'rel_key': 'l2-population', | ||
94 | 1179 | 'default': False, | ||
95 | 1180 | }, | ||
96 | 1181 | 'overlay_network_type': { | ||
97 | 1182 | 'rel_key': 'overlay-network-type', | ||
98 | 1183 | 'default': 'gre', | ||
99 | 1184 | }, | ||
100 | 1185 | 'neutron_security_groups': { | ||
101 | 1186 | 'rel_key': 'neutron-security-groups', | ||
102 | 1187 | 'default': False, | ||
103 | 1188 | }, | ||
104 | 1189 | 'network_device_mtu': { | ||
105 | 1190 | 'rel_key': 'network-device-mtu', | ||
106 | 1191 | 'default': None, | ||
107 | 1192 | }, | ||
108 | 1193 | 'enable_dvr': { | ||
109 | 1194 | 'rel_key': 'enable-dvr', | ||
110 | 1195 | 'default': False, | ||
111 | 1196 | }, | ||
112 | 1197 | 'enable_l3ha': { | ||
113 | 1198 | 'rel_key': 'enable-l3ha', | ||
114 | 1199 | 'default': False, | ||
115 | 1200 | }, | ||
116 | 1201 | } | ||
117 | 1202 | ctxt = self.get_neutron_options({}) | ||
118 | 1203 | for rid in relation_ids('neutron-plugin-api'): | ||
119 | 1204 | for unit in related_units(rid): | ||
120 | 1205 | rdata = relation_get(rid=rid, unit=unit) | ||
121 | 1206 | if 'l2-population' in rdata: | ||
122 | 1207 | ctxt.update(self.get_neutron_options(rdata)) | ||
123 | 1208 | |||
124 | 1209 | return ctxt | ||
125 | 1210 | |||
126 | 1211 | def get_neutron_options(self, rdata): | ||
127 | 1212 | settings = {} | ||
128 | 1213 | for nkey in self.neutron_defaults.keys(): | ||
129 | 1214 | defv = self.neutron_defaults[nkey]['default'] | ||
130 | 1215 | rkey = self.neutron_defaults[nkey]['rel_key'] | ||
131 | 1216 | if rkey in rdata.keys(): | ||
132 | 1217 | if type(defv) is bool: | ||
133 | 1218 | settings[nkey] = bool_from_string(rdata[rkey]) | ||
134 | 1219 | else: | ||
135 | 1220 | settings[nkey] = rdata[rkey] | ||
136 | 1221 | else: | ||
137 | 1222 | settings[nkey] = defv | ||
138 | 1223 | return settings | ||
139 | 1224 | |||
140 | 1225 | |||
141 | 1226 | class ExternalPortContext(NeutronPortContext): | ||
142 | 1227 | |||
143 | 1228 | def __call__(self): | ||
144 | 1229 | ctxt = {} | ||
145 | 1230 | ports = config('ext-port') | ||
146 | 1231 | if ports: | ||
147 | 1232 | ports = [p.strip() for p in ports.split()] | ||
148 | 1233 | ports = self.resolve_ports(ports) | ||
149 | 1234 | if ports: | ||
150 | 1235 | ctxt = {"ext_port": ports[0]} | ||
151 | 1236 | napi_settings = NeutronAPIContext()() | ||
152 | 1237 | mtu = napi_settings.get('network_device_mtu') | ||
153 | 1238 | if mtu: | ||
154 | 1239 | ctxt['ext_port_mtu'] = mtu | ||
155 | 1240 | |||
156 | 1241 | return ctxt | ||
157 | 1242 | |||
158 | 1243 | |||
159 | 1244 | class DataPortContext(NeutronPortContext): | ||
160 | 1245 | |||
161 | 1246 | def __call__(self): | ||
162 | 1247 | ports = config('data-port') | ||
163 | 1248 | if ports: | ||
164 | 1249 | portmap = parse_data_port_mappings(ports) | ||
165 | 1250 | ports = portmap.values() | ||
166 | 1251 | resolved = self.resolve_ports(ports) | ||
167 | 1252 | normalized = {get_nic_hwaddr(port): port for port in resolved | ||
168 | 1253 | if port not in ports} | ||
169 | 1254 | normalized.update({port: port for port in resolved | ||
170 | 1255 | if port in ports}) | ||
171 | 1256 | if resolved: | ||
172 | 1257 | return {bridge: normalized[port] for bridge, port in | ||
173 | 1258 | six.iteritems(portmap) if port in normalized.keys()} | ||
174 | 1259 | |||
175 | 1260 | return None | ||
176 | 1261 | |||
177 | 1262 | |||
178 | 1263 | class PhyNICMTUContext(DataPortContext): | ||
179 | 1264 | |||
180 | 1265 | def __call__(self): | ||
181 | 1266 | ctxt = {} | ||
182 | 1267 | mappings = super(PhyNICMTUContext, self).__call__() | ||
183 | 1268 | if mappings and mappings.values(): | ||
184 | 1269 | ports = mappings.values() | ||
185 | 1270 | napi_settings = NeutronAPIContext()() | ||
186 | 1271 | mtu = napi_settings.get('network_device_mtu') | ||
187 | 1272 | if mtu: | ||
188 | 1273 | ctxt["devs"] = '\\n'.join(ports) | ||
189 | 1274 | ctxt['mtu'] = mtu | ||
190 | 1275 | |||
191 | 1276 | return ctxt | ||
192 | 1277 | |||
193 | 1278 | |||
194 | 1279 | class NetworkServiceContext(OSContextGenerator): | ||
195 | 1280 | |||
196 | 1281 | def __init__(self, rel_name='quantum-network-service'): | ||
197 | 1282 | self.rel_name = rel_name | ||
198 | 1283 | self.interfaces = [rel_name] | ||
199 | 1284 | |||
200 | 1285 | def __call__(self): | ||
201 | 1286 | for rid in relation_ids(self.rel_name): | ||
202 | 1287 | for unit in related_units(rid): | ||
203 | 1288 | rdata = relation_get(rid=rid, unit=unit) | ||
204 | 1289 | ctxt = { | ||
205 | 1290 | 'keystone_host': rdata.get('keystone_host'), | ||
206 | 1291 | 'service_port': rdata.get('service_port'), | ||
207 | 1292 | 'auth_port': rdata.get('auth_port'), | ||
208 | 1293 | 'service_tenant': rdata.get('service_tenant'), | ||
209 | 1294 | 'service_username': rdata.get('service_username'), | ||
210 | 1295 | 'service_password': rdata.get('service_password'), | ||
211 | 1296 | 'quantum_host': rdata.get('quantum_host'), | ||
212 | 1297 | 'quantum_port': rdata.get('quantum_port'), | ||
213 | 1298 | 'quantum_url': rdata.get('quantum_url'), | ||
214 | 1299 | 'region': rdata.get('region'), | ||
215 | 1300 | 'service_protocol': | ||
216 | 1301 | rdata.get('service_protocol') or 'http', | ||
217 | 1302 | 'auth_protocol': | ||
218 | 1303 | rdata.get('auth_protocol') or 'http', | ||
219 | 1304 | } | ||
220 | 1305 | if context_complete(ctxt): | ||
221 | 1306 | return ctxt | ||
222 | 1307 | return {} | ||
223 | 1165 | 1308 | ||
224 | === added file 'hooks/charmhelpers/contrib/openstack/templates/git.upstart' | |||
225 | --- hooks/charmhelpers/contrib/openstack/templates/git.upstart 1970-01-01 00:00:00 +0000 | |||
226 | +++ hooks/charmhelpers/contrib/openstack/templates/git.upstart 2015-04-01 14:20:40 +0000 | |||
227 | @@ -0,0 +1,13 @@ | |||
228 | 1 | description "{{ service_description }}" | ||
229 | 2 | author "Juju {{ service_name }} Charm <juju@localhost>" | ||
230 | 3 | |||
231 | 4 | start on runlevel [2345] | ||
232 | 5 | stop on runlevel [!2345] | ||
233 | 6 | |||
234 | 7 | respawn | ||
235 | 8 | |||
236 | 9 | exec start-stop-daemon --start --chuid {{ user_name }} \ | ||
237 | 10 | --chdir {{ start_dir }} --name {{ process_name }} \ | ||
238 | 11 | --exec {{ executable_name }} -- \ | ||
239 | 12 | --config-file={{ config_file }} \ | ||
240 | 13 | --log-file={{ log_file }} | ||
241 | 0 | 14 | ||
242 | === added file 'hooks/charmhelpers/contrib/openstack/templates/section-zeromq' | |||
243 | --- hooks/charmhelpers/contrib/openstack/templates/section-zeromq 1970-01-01 00:00:00 +0000 | |||
244 | +++ hooks/charmhelpers/contrib/openstack/templates/section-zeromq 2015-04-01 14:20:40 +0000 | |||
245 | @@ -0,0 +1,14 @@ | |||
246 | 1 | {% if zmq_host -%} | ||
247 | 2 | # ZeroMQ configuration (restart-nonce: {{ zmq_nonce }}) | ||
248 | 3 | rpc_backend = zmq | ||
249 | 4 | rpc_zmq_host = {{ zmq_host }} | ||
250 | 5 | {% if zmq_redis_address -%} | ||
251 | 6 | rpc_zmq_matchmaker = redis | ||
252 | 7 | matchmaker_heartbeat_freq = 15 | ||
253 | 8 | matchmaker_heartbeat_ttl = 30 | ||
254 | 9 | [matchmaker_redis] | ||
255 | 10 | host = {{ zmq_redis_address }} | ||
256 | 11 | {% else -%} | ||
257 | 12 | rpc_zmq_matchmaker = ring | ||
258 | 13 | {% endif -%} | ||
259 | 14 | {% endif -%} | ||
260 | 0 | 15 | ||
261 | === removed file 'hooks/charmhelpers/contrib/openstack/templates/zeromq' | |||
262 | --- hooks/charmhelpers/contrib/openstack/templates/zeromq 2015-02-26 04:21:30 +0000 | |||
263 | +++ hooks/charmhelpers/contrib/openstack/templates/zeromq 1970-01-01 00:00:00 +0000 | |||
264 | @@ -1,14 +0,0 @@ | |||
265 | 1 | {% if zmq_host -%} | ||
266 | 2 | # ZeroMQ configuration (restart-nonce: {{ zmq_nonce }}) | ||
267 | 3 | rpc_backend = zmq | ||
268 | 4 | rpc_zmq_host = {{ zmq_host }} | ||
269 | 5 | {% if zmq_redis_address -%} | ||
270 | 6 | rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_redis.MatchMakerRedis | ||
271 | 7 | matchmaker_heartbeat_freq = 15 | ||
272 | 8 | matchmaker_heartbeat_ttl = 30 | ||
273 | 9 | [matchmaker_redis] | ||
274 | 10 | host = {{ zmq_redis_address }} | ||
275 | 11 | {% else -%} | ||
276 | 12 | rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_ring.MatchMakerRing | ||
277 | 13 | {% endif -%} | ||
278 | 14 | {% endif -%} | ||
279 | 15 | 0 | ||
280 | === modified file 'hooks/charmhelpers/contrib/openstack/utils.py' | |||
281 | --- hooks/charmhelpers/contrib/openstack/utils.py 2015-03-13 12:59:38 +0000 | |||
282 | +++ hooks/charmhelpers/contrib/openstack/utils.py 2015-04-01 14:20:40 +0000 | |||
283 | @@ -30,6 +30,10 @@ | |||
284 | 30 | 30 | ||
285 | 31 | from charmhelpers.contrib.network import ip | 31 | from charmhelpers.contrib.network import ip |
286 | 32 | 32 | ||
287 | 33 | from charmhelpers.core import ( | ||
288 | 34 | unitdata, | ||
289 | 35 | ) | ||
290 | 36 | |||
291 | 33 | from charmhelpers.core.hookenv import ( | 37 | from charmhelpers.core.hookenv import ( |
292 | 34 | config, | 38 | config, |
293 | 35 | log as juju_log, | 39 | log as juju_log, |
294 | @@ -330,6 +334,21 @@ | |||
295 | 330 | error_out("Invalid openstack-release specified: %s" % rel) | 334 | error_out("Invalid openstack-release specified: %s" % rel) |
296 | 331 | 335 | ||
297 | 332 | 336 | ||
298 | 337 | def config_value_changed(option): | ||
299 | 338 | """ | ||
300 | 339 | Determine if config value changed since last call to this function. | ||
301 | 340 | """ | ||
302 | 341 | hook_data = unitdata.HookData() | ||
303 | 342 | with hook_data(): | ||
304 | 343 | db = unitdata.kv() | ||
305 | 344 | current = config(option) | ||
306 | 345 | saved = db.get(option) | ||
307 | 346 | db.set(option, current) | ||
308 | 347 | if saved is None: | ||
309 | 348 | return False | ||
310 | 349 | return current != saved | ||
311 | 350 | |||
312 | 351 | |||
313 | 333 | def save_script_rc(script_path="scripts/scriptrc", **env_vars): | 352 | def save_script_rc(script_path="scripts/scriptrc", **env_vars): |
314 | 334 | """ | 353 | """ |
315 | 335 | Write an rc file in the charm-delivered directory containing | 354 | Write an rc file in the charm-delivered directory containing |
316 | @@ -469,82 +488,95 @@ | |||
317 | 469 | 488 | ||
318 | 470 | 489 | ||
319 | 471 | def git_install_requested(): | 490 | def git_install_requested(): |
322 | 472 | """Returns true if openstack-origin-git is specified.""" | 491 | """ |
323 | 473 | return config('openstack-origin-git') != "None" | 492 | Returns true if openstack-origin-git is specified. |
324 | 493 | """ | ||
325 | 494 | return config('openstack-origin-git') is not None | ||
326 | 474 | 495 | ||
327 | 475 | 496 | ||
328 | 476 | requirements_dir = None | 497 | requirements_dir = None |
329 | 477 | 498 | ||
330 | 478 | 499 | ||
333 | 479 | def git_clone_and_install(file_name, core_project): | 500 | def git_clone_and_install(projects_yaml, core_project): |
334 | 480 | """Clone/install all OpenStack repos specified in yaml config file.""" | 501 | """ |
335 | 502 | Clone/install all specified OpenStack repositories. | ||
336 | 503 | |||
337 | 504 | The expected format of projects_yaml is: | ||
338 | 505 | repositories: | ||
339 | 506 | - {name: keystone, | ||
340 | 507 | repository: 'git://git.openstack.org/openstack/keystone.git', | ||
341 | 508 | branch: 'stable/icehouse'} | ||
342 | 509 | - {name: requirements, | ||
343 | 510 | repository: 'git://git.openstack.org/openstack/requirements.git', | ||
344 | 511 | branch: 'stable/icehouse'} | ||
345 | 512 | directory: /mnt/openstack-git | ||
346 | 513 | |||
347 | 514 | The directory key is optional. | ||
348 | 515 | """ | ||
349 | 481 | global requirements_dir | 516 | global requirements_dir |
350 | 517 | parent_dir = '/mnt/openstack-git' | ||
351 | 482 | 518 | ||
353 | 483 | if file_name == "None": | 519 | if not projects_yaml: |
354 | 484 | return | 520 | return |
355 | 485 | 521 | ||
414 | 486 | yaml_file = os.path.join(charm_dir(), file_name) | 522 | projects = yaml.load(projects_yaml) |
415 | 487 | 523 | _git_validate_projects_yaml(projects, core_project) | |
416 | 488 | # clone/install the requirements project first | 524 | |
417 | 489 | installed = _git_clone_and_install_subset(yaml_file, | 525 | if 'directory' in projects.keys(): |
418 | 490 | whitelist=['requirements']) | 526 | parent_dir = projects['directory'] |
419 | 491 | if 'requirements' not in installed: | 527 | |
420 | 492 | error_out('requirements git repository must be specified') | 528 | for p in projects['repositories']: |
421 | 493 | 529 | repo = p['repository'] | |
422 | 494 | # clone/install all other projects except requirements and the core project | 530 | branch = p['branch'] |
423 | 495 | blacklist = ['requirements', core_project] | 531 | if p['name'] == 'requirements': |
424 | 496 | _git_clone_and_install_subset(yaml_file, blacklist=blacklist, | 532 | repo_dir = _git_clone_and_install_single(repo, branch, parent_dir, |
425 | 497 | update_requirements=True) | 533 | update_requirements=False) |
426 | 498 | 534 | requirements_dir = repo_dir | |
427 | 499 | # clone/install the core project | 535 | else: |
428 | 500 | whitelist = [core_project] | 536 | repo_dir = _git_clone_and_install_single(repo, branch, parent_dir, |
429 | 501 | installed = _git_clone_and_install_subset(yaml_file, whitelist=whitelist, | 537 | update_requirements=True) |
430 | 502 | update_requirements=True) | 538 | |
431 | 503 | if core_project not in installed: | 539 | |
432 | 504 | error_out('{} git repository must be specified'.format(core_project)) | 540 | def _git_validate_projects_yaml(projects, core_project): |
433 | 505 | 541 | """ | |
434 | 506 | 542 | Validate the projects yaml. | |
435 | 507 | def _git_clone_and_install_subset(yaml_file, whitelist=[], blacklist=[], | 543 | """ |
436 | 508 | update_requirements=False): | 544 | _git_ensure_key_exists('repositories', projects) |
437 | 509 | """Clone/install subset of OpenStack repos specified in yaml config file.""" | 545 | |
438 | 510 | global requirements_dir | 546 | for project in projects['repositories']: |
439 | 511 | installed = [] | 547 | _git_ensure_key_exists('name', project.keys()) |
440 | 512 | 548 | _git_ensure_key_exists('repository', project.keys()) | |
441 | 513 | with open(yaml_file, 'r') as fd: | 549 | _git_ensure_key_exists('branch', project.keys()) |
442 | 514 | projects = yaml.load(fd) | 550 | |
443 | 515 | for proj, val in projects.items(): | 551 | if projects['repositories'][0]['name'] != 'requirements': |
444 | 516 | # The project subset is chosen based on the following 3 rules: | 552 | error_out('{} git repo must be specified first'.format('requirements')) |
445 | 517 | # 1) If project is in blacklist, we don't clone/install it, period. | 553 | |
446 | 518 | # 2) If whitelist is empty, we clone/install everything else. | 554 | if projects['repositories'][-1]['name'] != core_project: |
447 | 519 | # 3) If whitelist is not empty, we clone/install everything in the | 555 | error_out('{} git repo must be specified last'.format(core_project)) |
448 | 520 | # whitelist. | 556 | |
449 | 521 | if proj in blacklist: | 557 | |
450 | 522 | continue | 558 | def _git_ensure_key_exists(key, keys): |
451 | 523 | if whitelist and proj not in whitelist: | 559 | """ |
452 | 524 | continue | 560 | Ensure that key exists in keys. |
453 | 525 | repo = val['repository'] | 561 | """ |
454 | 526 | branch = val['branch'] | 562 | if key not in keys: |
455 | 527 | repo_dir = _git_clone_and_install_single(repo, branch, | 563 | error_out('openstack-origin-git key \'{}\' is missing'.format(key)) |
456 | 528 | update_requirements) | 564 | |
457 | 529 | if proj == 'requirements': | 565 | |
458 | 530 | requirements_dir = repo_dir | 566 | def _git_clone_and_install_single(repo, branch, parent_dir, update_requirements): |
459 | 531 | installed.append(proj) | 567 | """ |
460 | 532 | return installed | 568 | Clone and install a single git repository. |
461 | 533 | 569 | """ | |
462 | 534 | 570 | dest_dir = os.path.join(parent_dir, os.path.basename(repo)) | |
463 | 535 | def _git_clone_and_install_single(repo, branch, update_requirements=False): | 571 | |
464 | 536 | """Clone and install a single git repository.""" | 572 | if not os.path.exists(parent_dir): |
465 | 537 | dest_parent_dir = "/mnt/openstack-git/" | 573 | juju_log('Directory already exists at {}. ' |
466 | 538 | dest_dir = os.path.join(dest_parent_dir, os.path.basename(repo)) | 574 | 'No need to create directory.'.format(parent_dir)) |
467 | 539 | 575 | os.mkdir(parent_dir) | |
410 | 540 | if not os.path.exists(dest_parent_dir): | ||
411 | 541 | juju_log('Host dir not mounted at {}. ' | ||
412 | 542 | 'Creating directory there instead.'.format(dest_parent_dir)) | ||
413 | 543 | os.mkdir(dest_parent_dir) | ||
468 | 544 | 576 | ||
469 | 545 | if not os.path.exists(dest_dir): | 577 | if not os.path.exists(dest_dir): |
470 | 546 | juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch)) | 578 | juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch)) |
472 | 547 | repo_dir = install_remote(repo, dest=dest_parent_dir, branch=branch) | 579 | repo_dir = install_remote(repo, dest=parent_dir, branch=branch) |
473 | 548 | else: | 580 | else: |
474 | 549 | repo_dir = dest_dir | 581 | repo_dir = dest_dir |
475 | 550 | 582 | ||
476 | @@ -561,16 +593,39 @@ | |||
477 | 561 | 593 | ||
478 | 562 | 594 | ||
479 | 563 | def _git_update_requirements(package_dir, reqs_dir): | 595 | def _git_update_requirements(package_dir, reqs_dir): |
481 | 564 | """Update from global requirements. | 596 | """ |
482 | 597 | Update from global requirements. | ||
483 | 565 | 598 | ||
486 | 566 | Update an OpenStack git directory's requirements.txt and | 599 | Update an OpenStack git directory's requirements.txt and |
487 | 567 | test-requirements.txt from global-requirements.txt.""" | 600 | test-requirements.txt from global-requirements.txt. |
488 | 601 | """ | ||
489 | 568 | orig_dir = os.getcwd() | 602 | orig_dir = os.getcwd() |
490 | 569 | os.chdir(reqs_dir) | 603 | os.chdir(reqs_dir) |
492 | 570 | cmd = "python update.py {}".format(package_dir) | 604 | cmd = ['python', 'update.py', package_dir] |
493 | 571 | try: | 605 | try: |
495 | 572 | subprocess.check_call(cmd.split(' ')) | 606 | subprocess.check_call(cmd) |
496 | 573 | except subprocess.CalledProcessError: | 607 | except subprocess.CalledProcessError: |
497 | 574 | package = os.path.basename(package_dir) | 608 | package = os.path.basename(package_dir) |
498 | 575 | error_out("Error updating {} from global-requirements.txt".format(package)) | 609 | error_out("Error updating {} from global-requirements.txt".format(package)) |
499 | 576 | os.chdir(orig_dir) | 610 | os.chdir(orig_dir) |
500 | 611 | |||
501 | 612 | |||
502 | 613 | def git_src_dir(projects_yaml, project): | ||
503 | 614 | """ | ||
504 | 615 | Return the directory where the specified project's source is located. | ||
505 | 616 | """ | ||
506 | 617 | parent_dir = '/mnt/openstack-git' | ||
507 | 618 | |||
508 | 619 | if not projects_yaml: | ||
509 | 620 | return | ||
510 | 621 | |||
511 | 622 | projects = yaml.load(projects_yaml) | ||
512 | 623 | |||
513 | 624 | if 'directory' in projects.keys(): | ||
514 | 625 | parent_dir = projects['directory'] | ||
515 | 626 | |||
516 | 627 | for p in projects['repositories']: | ||
517 | 628 | if p['name'] == project: | ||
518 | 629 | return os.path.join(parent_dir, os.path.basename(p['repository'])) | ||
519 | 630 | |||
520 | 631 | return None | ||
521 | 577 | 632 | ||
522 | === modified file 'hooks/charmhelpers/core/unitdata.py' | |||
523 | --- hooks/charmhelpers/core/unitdata.py 2015-02-19 04:20:01 +0000 | |||
524 | +++ hooks/charmhelpers/core/unitdata.py 2015-04-01 14:20:40 +0000 | |||
525 | @@ -443,7 +443,7 @@ | |||
526 | 443 | data = hookenv.execution_environment() | 443 | data = hookenv.execution_environment() |
527 | 444 | self.conf = conf_delta = self.kv.delta(data['conf'], 'config') | 444 | self.conf = conf_delta = self.kv.delta(data['conf'], 'config') |
528 | 445 | self.rels = rels_delta = self.kv.delta(data['rels'], 'rels') | 445 | self.rels = rels_delta = self.kv.delta(data['rels'], 'rels') |
530 | 446 | self.kv.set('env', data['env']) | 446 | self.kv.set('env', dict(data['env'])) |
531 | 447 | self.kv.set('unit', data['unit']) | 447 | self.kv.set('unit', data['unit']) |
532 | 448 | self.kv.set('relid', data.get('relid')) | 448 | self.kv.set('relid', data.get('relid')) |
533 | 449 | return conf_delta, rels_delta | 449 | return conf_delta, rels_delta |
534 | 450 | 450 | ||
535 | === modified file 'hooks/neutron_api_hooks.py' | |||
536 | --- hooks/neutron_api_hooks.py 2015-04-01 11:26:15 +0000 | |||
537 | +++ hooks/neutron_api_hooks.py 2015-04-01 14:20:40 +0000 | |||
538 | @@ -34,6 +34,7 @@ | |||
539 | 34 | from charmhelpers.contrib.openstack.utils import ( | 34 | from charmhelpers.contrib.openstack.utils import ( |
540 | 35 | configure_installation_source, | 35 | configure_installation_source, |
541 | 36 | openstack_upgrade_available, | 36 | openstack_upgrade_available, |
542 | 37 | os_requires_version, | ||
543 | 37 | sync_db_with_multi_ipv6_addresses | 38 | sync_db_with_multi_ipv6_addresses |
544 | 38 | ) | 39 | ) |
545 | 39 | 40 | ||
546 | @@ -48,7 +49,8 @@ | |||
547 | 48 | register_configs, | 49 | register_configs, |
548 | 49 | restart_map, | 50 | restart_map, |
549 | 50 | services, | 51 | services, |
551 | 51 | setup_ipv6 | 52 | setup_ipv6, |
552 | 53 | get_topics, | ||
553 | 52 | ) | 54 | ) |
554 | 53 | from neutron_api_context import ( | 55 | from neutron_api_context import ( |
555 | 54 | get_dvr, | 56 | get_dvr, |
556 | @@ -154,6 +156,8 @@ | |||
557 | 154 | amqp_joined(relation_id=r_id) | 156 | amqp_joined(relation_id=r_id) |
558 | 155 | for r_id in relation_ids('identity-service'): | 157 | for r_id in relation_ids('identity-service'): |
559 | 156 | identity_joined(rid=r_id) | 158 | identity_joined(rid=r_id) |
560 | 159 | for rid in relation_ids('zeromq-configuration'): | ||
561 | 160 | zeromq_configuration_relation_joined(rid) | ||
562 | 157 | [cluster_joined(rid) for rid in relation_ids('cluster')] | 161 | [cluster_joined(rid) for rid in relation_ids('cluster')] |
563 | 158 | 162 | ||
564 | 159 | 163 | ||
565 | @@ -424,6 +428,20 @@ | |||
566 | 424 | neutron_api_relation_joined(rid=rid) | 428 | neutron_api_relation_joined(rid=rid) |
567 | 425 | 429 | ||
568 | 426 | 430 | ||
569 | 431 | @hooks.hook('zeromq-configuration-relation-joined') | ||
570 | 432 | @os_requires_version('kilo', 'neutron-server') | ||
571 | 433 | def zeromq_configuration_relation_joined(relid=None): | ||
572 | 434 | relation_set(relation_id=relid, | ||
573 | 435 | topics=" ".join(get_topics()), | ||
574 | 436 | users="neutron") | ||
575 | 437 | |||
576 | 438 | |||
577 | 439 | @hooks.hook('zeromq-configuration-relation-changed') | ||
578 | 440 | @restart_on_change(restart_map(), stopstart=True) | ||
579 | 441 | def zeromq_configuration_relation_changed(): | ||
580 | 442 | CONFIGS.write_all() | ||
581 | 443 | |||
582 | 444 | |||
583 | 427 | @hooks.hook('nrpe-external-master-relation-joined', | 445 | @hooks.hook('nrpe-external-master-relation-joined', |
584 | 428 | 'nrpe-external-master-relation-changed') | 446 | 'nrpe-external-master-relation-changed') |
585 | 429 | def update_nrpe_config(): | 447 | def update_nrpe_config(): |
586 | 430 | 448 | ||
587 | === modified file 'hooks/neutron_api_utils.py' | |||
588 | --- hooks/neutron_api_utils.py 2015-03-31 07:53:39 +0000 | |||
589 | +++ hooks/neutron_api_utils.py 2015-04-01 14:20:40 +0000 | |||
590 | @@ -83,6 +83,8 @@ | |||
591 | 83 | service_user='neutron'), | 83 | service_user='neutron'), |
592 | 84 | neutron_api_context.NeutronCCContext(), | 84 | neutron_api_context.NeutronCCContext(), |
593 | 85 | context.SyslogContext(), | 85 | context.SyslogContext(), |
594 | 86 | context.ZeroMQContext(), | ||
595 | 87 | context.NotificationDriverContext(), | ||
596 | 86 | context.BindHostContext(), | 88 | context.BindHostContext(), |
597 | 87 | context.WorkerConfigContext()], | 89 | context.WorkerConfigContext()], |
598 | 88 | }), | 90 | }), |
599 | @@ -231,6 +233,16 @@ | |||
600 | 231 | configs.set_release(openstack_release=new_os_rel) | 233 | configs.set_release(openstack_release=new_os_rel) |
601 | 232 | 234 | ||
602 | 233 | 235 | ||
603 | 236 | def get_topics(): | ||
604 | 237 | return ['q-l3-plugin', | ||
605 | 238 | 'q-firewall-plugin', | ||
606 | 239 | 'n-lbaas-plugin', | ||
607 | 240 | 'ipsec_driver', | ||
608 | 241 | 'q-metering-plugin', | ||
609 | 242 | 'q-plugin', | ||
610 | 243 | 'neutron'] | ||
611 | 244 | |||
612 | 245 | |||
613 | 234 | def setup_ipv6(): | 246 | def setup_ipv6(): |
614 | 235 | ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower() | 247 | ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower() |
615 | 236 | if ubuntu_rel < "trusty": | 248 | if ubuntu_rel < "trusty": |
616 | 237 | 249 | ||
617 | === added symlink 'hooks/zeromq-configuration-relation-changed' | |||
618 | === target is u'neutron_api_hooks.py' | |||
619 | === added symlink 'hooks/zeromq-configuration-relation-joined' | |||
620 | === target is u'neutron_api_hooks.py' | |||
621 | === modified file 'metadata.yaml' | |||
622 | --- metadata.yaml 2014-10-30 03:30:36 +0000 | |||
623 | +++ metadata.yaml 2015-04-01 14:20:40 +0000 | |||
624 | @@ -34,6 +34,9 @@ | |||
625 | 34 | ha: | 34 | ha: |
626 | 35 | interface: hacluster | 35 | interface: hacluster |
627 | 36 | scope: container | 36 | scope: container |
628 | 37 | zeromq-configuration: | ||
629 | 38 | interface: zeromq-configuration | ||
630 | 39 | scope: container | ||
631 | 37 | peers: | 40 | peers: |
632 | 38 | cluster: | 41 | cluster: |
633 | 39 | interface: neutron-api-ha | 42 | interface: neutron-api-ha |
634 | 40 | 43 | ||
635 | === modified file 'templates/icehouse/neutron.conf' | |||
636 | --- templates/icehouse/neutron.conf 2015-03-13 12:59:38 +0000 | |||
637 | +++ templates/icehouse/neutron.conf 2015-04-01 14:20:40 +0000 | |||
638 | @@ -1,3 +1,4 @@ | |||
639 | 1 | # icehouse | ||
640 | 1 | ############################################################################### | 2 | ############################################################################### |
641 | 2 | # [ WARNING ] | 3 | # [ WARNING ] |
642 | 3 | # Configuration file maintained by Juju. Local changes may be overwritten. | 4 | # Configuration file maintained by Juju. Local changes may be overwritten. |
643 | @@ -11,7 +12,10 @@ | |||
644 | 11 | lock_path = $state_path/lock | 12 | lock_path = $state_path/lock |
645 | 12 | bind_host = {{ bind_host }} | 13 | bind_host = {{ bind_host }} |
646 | 13 | auth_strategy = keystone | 14 | auth_strategy = keystone |
647 | 15 | |||
648 | 16 | {% if notifications == 'True' -%} | ||
649 | 14 | notification_driver = neutron.openstack.common.notifier.rpc_notifier | 17 | notification_driver = neutron.openstack.common.notifier.rpc_notifier |
650 | 18 | {% endif -%} | ||
651 | 15 | api_workers = {{ workers }} | 19 | api_workers = {{ workers }} |
652 | 16 | rpc_workers = {{ workers }} | 20 | rpc_workers = {{ workers }} |
653 | 17 | 21 | ||
654 | 18 | 22 | ||
655 | === modified file 'templates/kilo/neutron.conf' | |||
656 | --- templates/kilo/neutron.conf 2015-03-31 07:53:39 +0000 | |||
657 | +++ templates/kilo/neutron.conf 2015-04-01 14:20:40 +0000 | |||
658 | @@ -1,3 +1,4 @@ | |||
659 | 1 | # kilo | ||
660 | 1 | ############################################################################### | 2 | ############################################################################### |
661 | 2 | # [ WARNING ] | 3 | # [ WARNING ] |
662 | 3 | # Configuration file maintained by Juju. Local changes may be overwritten. | 4 | # Configuration file maintained by Juju. Local changes may be overwritten. |
663 | @@ -51,6 +52,8 @@ | |||
664 | 51 | nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.0 | 52 | nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.0 |
665 | 52 | {% endif -%} | 53 | {% endif -%} |
666 | 53 | 54 | ||
667 | 55 | {% include "section-zeromq" %} | ||
668 | 56 | |||
669 | 54 | [quotas] | 57 | [quotas] |
670 | 55 | quota_driver = neutron.db.quota_db.DbQuotaDriver | 58 | quota_driver = neutron.db.quota_db.DbQuotaDriver |
671 | 56 | {% if neutron_security_groups -%} | 59 | {% if neutron_security_groups -%} |
672 | 57 | 60 | ||
673 | === modified file 'tests/charmhelpers/contrib/openstack/amulet/deployment.py' | |||
674 | --- tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-02-17 07:10:15 +0000 | |||
675 | +++ tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-04-01 14:20:40 +0000 | |||
676 | @@ -15,6 +15,7 @@ | |||
677 | 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/>. |
678 | 16 | 16 | ||
679 | 17 | import six | 17 | import six |
680 | 18 | from collections import OrderedDict | ||
681 | 18 | from charmhelpers.contrib.amulet.deployment import ( | 19 | from charmhelpers.contrib.amulet.deployment import ( |
682 | 19 | AmuletDeployment | 20 | AmuletDeployment |
683 | 20 | ) | 21 | ) |
684 | @@ -100,12 +101,34 @@ | |||
685 | 100 | """ | 101 | """ |
686 | 101 | (self.precise_essex, self.precise_folsom, self.precise_grizzly, | 102 | (self.precise_essex, self.precise_folsom, self.precise_grizzly, |
687 | 102 | self.precise_havana, self.precise_icehouse, | 103 | self.precise_havana, self.precise_icehouse, |
689 | 103 | self.trusty_icehouse) = range(6) | 104 | self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8) |
690 | 104 | releases = { | 105 | releases = { |
691 | 105 | ('precise', None): self.precise_essex, | 106 | ('precise', None): self.precise_essex, |
692 | 106 | ('precise', 'cloud:precise-folsom'): self.precise_folsom, | 107 | ('precise', 'cloud:precise-folsom'): self.precise_folsom, |
693 | 107 | ('precise', 'cloud:precise-grizzly'): self.precise_grizzly, | 108 | ('precise', 'cloud:precise-grizzly'): self.precise_grizzly, |
694 | 108 | ('precise', 'cloud:precise-havana'): self.precise_havana, | 109 | ('precise', 'cloud:precise-havana'): self.precise_havana, |
695 | 109 | ('precise', 'cloud:precise-icehouse'): self.precise_icehouse, | 110 | ('precise', 'cloud:precise-icehouse'): self.precise_icehouse, |
697 | 110 | ('trusty', None): self.trusty_icehouse} | 111 | ('trusty', None): self.trusty_icehouse, |
698 | 112 | ('trusty', 'cloud:trusty-juno'): self.trusty_juno, | ||
699 | 113 | ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo} | ||
700 | 111 | return releases[(self.series, self.openstack)] | 114 | return releases[(self.series, self.openstack)] |
701 | 115 | |||
702 | 116 | def _get_openstack_release_string(self): | ||
703 | 117 | """Get openstack release string. | ||
704 | 118 | |||
705 | 119 | Return a string representing the openstack release. | ||
706 | 120 | """ | ||
707 | 121 | releases = OrderedDict([ | ||
708 | 122 | ('precise', 'essex'), | ||
709 | 123 | ('quantal', 'folsom'), | ||
710 | 124 | ('raring', 'grizzly'), | ||
711 | 125 | ('saucy', 'havana'), | ||
712 | 126 | ('trusty', 'icehouse'), | ||
713 | 127 | ('utopic', 'juno'), | ||
714 | 128 | ('vivid', 'kilo'), | ||
715 | 129 | ]) | ||
716 | 130 | if self.openstack: | ||
717 | 131 | os_origin = self.openstack.split(':')[1] | ||
718 | 132 | return os_origin.split('%s-' % self.series)[1].split('/')[0] | ||
719 | 133 | else: | ||
720 | 134 | return releases[self.series] | ||
721 | 112 | 135 | ||
722 | === modified file 'unit_tests/test_neutron_api_hooks.py' | |||
723 | --- unit_tests/test_neutron_api_hooks.py 2015-04-01 11:26:15 +0000 | |||
724 | +++ unit_tests/test_neutron_api_hooks.py 2015-04-01 14:20:40 +0000 | |||
725 | @@ -44,6 +44,7 @@ | |||
726 | 44 | 'log', | 44 | 'log', |
727 | 45 | 'open_port', | 45 | 'open_port', |
728 | 46 | 'openstack_upgrade_available', | 46 | 'openstack_upgrade_available', |
729 | 47 | 'os_requires_version', | ||
730 | 47 | 'relation_get', | 48 | 'relation_get', |
731 | 48 | 'relation_ids', | 49 | 'relation_ids', |
732 | 49 | 'relation_set', | 50 | 'relation_set', |
733 | @@ -117,12 +118,14 @@ | |||
734 | 117 | _amqp_rel_joined = self.patch('amqp_joined') | 118 | _amqp_rel_joined = self.patch('amqp_joined') |
735 | 118 | _id_rel_joined = self.patch('identity_joined') | 119 | _id_rel_joined = self.patch('identity_joined') |
736 | 119 | _id_cluster_joined = self.patch('cluster_joined') | 120 | _id_cluster_joined = self.patch('cluster_joined') |
737 | 121 | _zmq_joined = self.patch('zeromq_configuration_relation_joined') | ||
738 | 120 | self._call_hook('config-changed') | 122 | self._call_hook('config-changed') |
739 | 121 | self.assertTrue(_n_api_rel_joined.called) | 123 | self.assertTrue(_n_api_rel_joined.called) |
740 | 122 | self.assertTrue(_n_plugin_api_rel_joined.called) | 124 | self.assertTrue(_n_plugin_api_rel_joined.called) |
741 | 123 | self.assertTrue(_amqp_rel_joined.called) | 125 | self.assertTrue(_amqp_rel_joined.called) |
742 | 124 | self.assertTrue(_id_rel_joined.called) | 126 | self.assertTrue(_id_rel_joined.called) |
743 | 125 | self.assertTrue(_id_cluster_joined.called) | 127 | self.assertTrue(_id_cluster_joined.called) |
744 | 128 | self.assertTrue(_zmq_joined.called) | ||
745 | 126 | self.assertTrue(self.CONFIGS.write_all.called) | 129 | self.assertTrue(self.CONFIGS.write_all.called) |
746 | 127 | self.assertTrue(self.do_openstack_upgrade.called) | 130 | self.assertTrue(self.do_openstack_upgrade.called) |
747 | 128 | self.assertTrue(self.apt_install.called) | 131 | self.assertTrue(self.apt_install.called) |
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: 10.98.191. 181:8080/ job/charm_ lint_check/ 698/
http://
MP URL: /code.launchpad .net/~openstack -charmers/ charms/ trusty/ neutron- api/0mq/ +merge/ 238881
https:/
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 jenkins/ workspace/ charm_lint_ check/make- lint.698:
/var/lib/
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. 10.98.191. 181:8080/
http://