Merge lp:~openstack-charmers/charms/trusty/neutron-openvswitch/0mq into lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
- Trusty Tahr (14.04)
- 0mq
- Merge into next
Status: | Merged |
---|---|
Merged at revision: | 55 |
Proposed branch: | lp:~openstack-charmers/charms/trusty/neutron-openvswitch/0mq |
Merge into: | lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next |
Diff against target: |
556 lines (+249/-90) 13 files modified
hooks/charmhelpers/contrib/openstack/amulet/deployment.py (+25/-2) 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_ovs_hooks.py (+21/-0) hooks/neutron_ovs_utils.py (+15/-1) metadata.yaml (+4/-0) templates/icehouse/neutron.conf (+2/-1) templates/kilo/neutron.conf (+2/-0) tests/charmhelpers/contrib/openstack/amulet/deployment.py (+25/-2) unit_tests/test_neutron_ovs_hooks.py (+3/-0) |
To merge this branch: | bzr merge lp:~openstack-charmers/charms/trusty/neutron-openvswitch/0mq |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Liam Young (community) | Approve | ||
Ryan Beisner (community) | Needs Fixing | ||
James Page | Needs Fixing | ||
Review via email: mp+238874@code.launchpad.net |
Commit message
Description of the change
Ryan Beisner (1chb1n) wrote : | # |
Ryan Beisner (1chb1n) wrote : | # |
UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.
#498 neutron-
charm_unit_test
This build:
http://
MP URL:
https:/
Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-openvswitch/0mq
Results summary:
UNIT FAIL: unit-test failed
UNIT Results (max last 25 lines) from
/var/lib/
'neutron_
'neutron_
- 'neutron_
? ^^ --
+ 'neutron_
? ^^^
'neutron_url': 'https:/
'overlay_
'use_syslog': True,
'verbose': True}
Name Stmts Miss Cover Missing
-------
hooks/neutron_
hooks/neutron_
hooks/neutron_
-------
TOTAL 143 20 86%
-------
Ran 13 tests in 0.244s
FAILED (errors=5, failures=1)
make: *** [test] Error 1
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://
Ryan Beisner (1chb1n) wrote : | # |
UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.
#249 neutron-
charm_amulet_test
This build:
http://
MP URL:
https:/
Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-openvswitch/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://
- 45. By Liam Young
-
Fix lint and unit tests
Ryan Beisner (1chb1n) wrote : | # |
UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.
#257 neutron-
charm_amulet_test
This build:
http://
MP URL:
https:/
Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-openvswitch/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://
Ryan Beisner (1chb1n) wrote : | # |
UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.
#506 neutron-
charm_unit_test
This build:
http://
MP URL:
https:/
Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-openvswitch/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 143 17 88%
-------
Ran 13 tests in 0.196s
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://
Ryan Beisner (1chb1n) wrote : | # |
UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.
#700 neutron-
charm_lint_check
This build:
http://
MP URL:
https:/
Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-openvswitch/0mq
Results summary:
LINT OK: believed to pass, but you should confirm results
LINT Results (max last 25 lines) from
/var/lib/
I: missing recommended hook start
I: config.yaml: option data-port has no default value
I: config.yaml: option os-data-network 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://
James Page (james-page) : | # |
- 46. By James Page
-
Rebase on next
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #163 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #197 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #177 neutron-
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://
- 47. By James Page
-
Resync helpers
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #736 neutron-
UNIT FAIL: unit-test failed
UNIT Results (max last 2 lines):
FAILED (errors=3)
make: *** [unit_test] Error 1
Full unit test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #707 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #892 neutron-
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://
Ryan Beisner (1chb1n) wrote : | # |
All T, U & J deploy tests fail with:
http://
11:11:08 2015-01-13 11:11:08 [DEBUG] deployer.env: Delta unit: neutron-
11:11:08 2015-01-13 11:11:08 [ERROR] deployer.env: The following units had errors:
11:11:08 unit: neutron-
11:11:08 2015-01-13 11:11:08 [INFO] deployer.cli: Deployment stopped. run time: 624.02
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
unit-neutron-
- 48. By James Page
-
Add missing files
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #821 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #792 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #977 neutron-
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://
Ryan Beisner (1chb1n) wrote : | # |
FYI - P, T, U deploy tests fail with: http://
- 49. By James Page
-
Use centralized zeromq template
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #868 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #839 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1063 neutron-
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://
- 50. By James Page
-
Fixup zeromq sections
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #844 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #873 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1068 neutron-
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://
- 51. By James Page
-
Resync helper
- 52. By James Page
-
Resync helper
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #866 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #895 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1090 neutron-
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://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #902 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #873 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #1097 neutron-
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://
- 53. By James Page
-
Switch back to trunk charm-helpers
- 54. By James Page
-
Rebase and resync
- 55. By James Page
-
Specialize configuration for juno + zeromq
- 56. By James Page
-
Update headers for templates
- 57. By James Page
-
Add kilo zeromq template
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1990 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #2201 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #2147 neutron-
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://
- 58. By James Page
-
Rebase
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #2680 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #2471 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #2509 neutron-
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://
- 59. By James Page
-
Make 0mq support >= kilo
- 60. By James Page
-
Rebase, resync
- 61. By James Page
-
Sortout topic registration
- 62. 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-02-16 11:16:11 +0000 |
3 | +++ hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-04-01 14:19:25 +0000 |
4 | @@ -15,6 +15,7 @@ |
5 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. |
6 | |
7 | import six |
8 | +from collections import OrderedDict |
9 | from charmhelpers.contrib.amulet.deployment import ( |
10 | AmuletDeployment |
11 | ) |
12 | @@ -100,12 +101,34 @@ |
13 | """ |
14 | (self.precise_essex, self.precise_folsom, self.precise_grizzly, |
15 | self.precise_havana, self.precise_icehouse, |
16 | - self.trusty_icehouse) = range(6) |
17 | + self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8) |
18 | releases = { |
19 | ('precise', None): self.precise_essex, |
20 | ('precise', 'cloud:precise-folsom'): self.precise_folsom, |
21 | ('precise', 'cloud:precise-grizzly'): self.precise_grizzly, |
22 | ('precise', 'cloud:precise-havana'): self.precise_havana, |
23 | ('precise', 'cloud:precise-icehouse'): self.precise_icehouse, |
24 | - ('trusty', None): self.trusty_icehouse} |
25 | + ('trusty', None): self.trusty_icehouse, |
26 | + ('trusty', 'cloud:trusty-juno'): self.trusty_juno, |
27 | + ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo} |
28 | return releases[(self.series, self.openstack)] |
29 | + |
30 | + def _get_openstack_release_string(self): |
31 | + """Get openstack release string. |
32 | + |
33 | + Return a string representing the openstack release. |
34 | + """ |
35 | + releases = OrderedDict([ |
36 | + ('precise', 'essex'), |
37 | + ('quantal', 'folsom'), |
38 | + ('raring', 'grizzly'), |
39 | + ('saucy', 'havana'), |
40 | + ('trusty', 'icehouse'), |
41 | + ('utopic', 'juno'), |
42 | + ('vivid', 'kilo'), |
43 | + ]) |
44 | + if self.openstack: |
45 | + os_origin = self.openstack.split(':')[1] |
46 | + return os_origin.split('%s-' % self.series)[1].split('/')[0] |
47 | + else: |
48 | + return releases[self.series] |
49 | |
50 | === added file 'hooks/charmhelpers/contrib/openstack/templates/git.upstart' |
51 | --- hooks/charmhelpers/contrib/openstack/templates/git.upstart 1970-01-01 00:00:00 +0000 |
52 | +++ hooks/charmhelpers/contrib/openstack/templates/git.upstart 2015-04-01 14:19:25 +0000 |
53 | @@ -0,0 +1,13 @@ |
54 | +description "{{ service_description }}" |
55 | +author "Juju {{ service_name }} Charm <juju@localhost>" |
56 | + |
57 | +start on runlevel [2345] |
58 | +stop on runlevel [!2345] |
59 | + |
60 | +respawn |
61 | + |
62 | +exec start-stop-daemon --start --chuid {{ user_name }} \ |
63 | + --chdir {{ start_dir }} --name {{ process_name }} \ |
64 | + --exec {{ executable_name }} -- \ |
65 | + --config-file={{ config_file }} \ |
66 | + --log-file={{ log_file }} |
67 | |
68 | === added file 'hooks/charmhelpers/contrib/openstack/templates/section-zeromq' |
69 | --- hooks/charmhelpers/contrib/openstack/templates/section-zeromq 1970-01-01 00:00:00 +0000 |
70 | +++ hooks/charmhelpers/contrib/openstack/templates/section-zeromq 2015-04-01 14:19:25 +0000 |
71 | @@ -0,0 +1,14 @@ |
72 | +{% if zmq_host -%} |
73 | +# ZeroMQ configuration (restart-nonce: {{ zmq_nonce }}) |
74 | +rpc_backend = zmq |
75 | +rpc_zmq_host = {{ zmq_host }} |
76 | +{% if zmq_redis_address -%} |
77 | +rpc_zmq_matchmaker = redis |
78 | +matchmaker_heartbeat_freq = 15 |
79 | +matchmaker_heartbeat_ttl = 30 |
80 | +[matchmaker_redis] |
81 | +host = {{ zmq_redis_address }} |
82 | +{% else -%} |
83 | +rpc_zmq_matchmaker = ring |
84 | +{% endif -%} |
85 | +{% endif -%} |
86 | |
87 | === removed file 'hooks/charmhelpers/contrib/openstack/templates/zeromq' |
88 | --- hooks/charmhelpers/contrib/openstack/templates/zeromq 2015-03-04 09:52:38 +0000 |
89 | +++ hooks/charmhelpers/contrib/openstack/templates/zeromq 1970-01-01 00:00:00 +0000 |
90 | @@ -1,14 +0,0 @@ |
91 | -{% if zmq_host -%} |
92 | -# ZeroMQ configuration (restart-nonce: {{ zmq_nonce }}) |
93 | -rpc_backend = zmq |
94 | -rpc_zmq_host = {{ zmq_host }} |
95 | -{% if zmq_redis_address -%} |
96 | -rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_redis.MatchMakerRedis |
97 | -matchmaker_heartbeat_freq = 15 |
98 | -matchmaker_heartbeat_ttl = 30 |
99 | -[matchmaker_redis] |
100 | -host = {{ zmq_redis_address }} |
101 | -{% else -%} |
102 | -rpc_zmq_matchmaker = oslo.messaging._drivers.matchmaker_ring.MatchMakerRing |
103 | -{% endif -%} |
104 | -{% endif -%} |
105 | |
106 | === modified file 'hooks/charmhelpers/contrib/openstack/utils.py' |
107 | --- hooks/charmhelpers/contrib/openstack/utils.py 2015-03-25 09:49:01 +0000 |
108 | +++ hooks/charmhelpers/contrib/openstack/utils.py 2015-04-01 14:19:25 +0000 |
109 | @@ -30,6 +30,10 @@ |
110 | |
111 | from charmhelpers.contrib.network import ip |
112 | |
113 | +from charmhelpers.core import ( |
114 | + unitdata, |
115 | +) |
116 | + |
117 | from charmhelpers.core.hookenv import ( |
118 | config, |
119 | log as juju_log, |
120 | @@ -330,6 +334,21 @@ |
121 | error_out("Invalid openstack-release specified: %s" % rel) |
122 | |
123 | |
124 | +def config_value_changed(option): |
125 | + """ |
126 | + Determine if config value changed since last call to this function. |
127 | + """ |
128 | + hook_data = unitdata.HookData() |
129 | + with hook_data(): |
130 | + db = unitdata.kv() |
131 | + current = config(option) |
132 | + saved = db.get(option) |
133 | + db.set(option, current) |
134 | + if saved is None: |
135 | + return False |
136 | + return current != saved |
137 | + |
138 | + |
139 | def save_script_rc(script_path="scripts/scriptrc", **env_vars): |
140 | """ |
141 | Write an rc file in the charm-delivered directory containing |
142 | @@ -469,82 +488,95 @@ |
143 | |
144 | |
145 | def git_install_requested(): |
146 | - """Returns true if openstack-origin-git is specified.""" |
147 | - return config('openstack-origin-git') != "None" |
148 | + """ |
149 | + Returns true if openstack-origin-git is specified. |
150 | + """ |
151 | + return config('openstack-origin-git') is not None |
152 | |
153 | |
154 | requirements_dir = None |
155 | |
156 | |
157 | -def git_clone_and_install(file_name, core_project): |
158 | - """Clone/install all OpenStack repos specified in yaml config file.""" |
159 | +def git_clone_and_install(projects_yaml, core_project): |
160 | + """ |
161 | + Clone/install all specified OpenStack repositories. |
162 | + |
163 | + The expected format of projects_yaml is: |
164 | + repositories: |
165 | + - {name: keystone, |
166 | + repository: 'git://git.openstack.org/openstack/keystone.git', |
167 | + branch: 'stable/icehouse'} |
168 | + - {name: requirements, |
169 | + repository: 'git://git.openstack.org/openstack/requirements.git', |
170 | + branch: 'stable/icehouse'} |
171 | + directory: /mnt/openstack-git |
172 | + |
173 | + The directory key is optional. |
174 | + """ |
175 | global requirements_dir |
176 | + parent_dir = '/mnt/openstack-git' |
177 | |
178 | - if file_name == "None": |
179 | + if not projects_yaml: |
180 | return |
181 | |
182 | - yaml_file = os.path.join(charm_dir(), file_name) |
183 | - |
184 | - # clone/install the requirements project first |
185 | - installed = _git_clone_and_install_subset(yaml_file, |
186 | - whitelist=['requirements']) |
187 | - if 'requirements' not in installed: |
188 | - error_out('requirements git repository must be specified') |
189 | - |
190 | - # clone/install all other projects except requirements and the core project |
191 | - blacklist = ['requirements', core_project] |
192 | - _git_clone_and_install_subset(yaml_file, blacklist=blacklist, |
193 | - update_requirements=True) |
194 | - |
195 | - # clone/install the core project |
196 | - whitelist = [core_project] |
197 | - installed = _git_clone_and_install_subset(yaml_file, whitelist=whitelist, |
198 | - update_requirements=True) |
199 | - if core_project not in installed: |
200 | - error_out('{} git repository must be specified'.format(core_project)) |
201 | - |
202 | - |
203 | -def _git_clone_and_install_subset(yaml_file, whitelist=[], blacklist=[], |
204 | - update_requirements=False): |
205 | - """Clone/install subset of OpenStack repos specified in yaml config file.""" |
206 | - global requirements_dir |
207 | - installed = [] |
208 | - |
209 | - with open(yaml_file, 'r') as fd: |
210 | - projects = yaml.load(fd) |
211 | - for proj, val in projects.items(): |
212 | - # The project subset is chosen based on the following 3 rules: |
213 | - # 1) If project is in blacklist, we don't clone/install it, period. |
214 | - # 2) If whitelist is empty, we clone/install everything else. |
215 | - # 3) If whitelist is not empty, we clone/install everything in the |
216 | - # whitelist. |
217 | - if proj in blacklist: |
218 | - continue |
219 | - if whitelist and proj not in whitelist: |
220 | - continue |
221 | - repo = val['repository'] |
222 | - branch = val['branch'] |
223 | - repo_dir = _git_clone_and_install_single(repo, branch, |
224 | - update_requirements) |
225 | - if proj == 'requirements': |
226 | - requirements_dir = repo_dir |
227 | - installed.append(proj) |
228 | - return installed |
229 | - |
230 | - |
231 | -def _git_clone_and_install_single(repo, branch, update_requirements=False): |
232 | - """Clone and install a single git repository.""" |
233 | - dest_parent_dir = "/mnt/openstack-git/" |
234 | - dest_dir = os.path.join(dest_parent_dir, os.path.basename(repo)) |
235 | - |
236 | - if not os.path.exists(dest_parent_dir): |
237 | - juju_log('Host dir not mounted at {}. ' |
238 | - 'Creating directory there instead.'.format(dest_parent_dir)) |
239 | - os.mkdir(dest_parent_dir) |
240 | + projects = yaml.load(projects_yaml) |
241 | + _git_validate_projects_yaml(projects, core_project) |
242 | + |
243 | + if 'directory' in projects.keys(): |
244 | + parent_dir = projects['directory'] |
245 | + |
246 | + for p in projects['repositories']: |
247 | + repo = p['repository'] |
248 | + branch = p['branch'] |
249 | + if p['name'] == 'requirements': |
250 | + repo_dir = _git_clone_and_install_single(repo, branch, parent_dir, |
251 | + update_requirements=False) |
252 | + requirements_dir = repo_dir |
253 | + else: |
254 | + repo_dir = _git_clone_and_install_single(repo, branch, parent_dir, |
255 | + update_requirements=True) |
256 | + |
257 | + |
258 | +def _git_validate_projects_yaml(projects, core_project): |
259 | + """ |
260 | + Validate the projects yaml. |
261 | + """ |
262 | + _git_ensure_key_exists('repositories', projects) |
263 | + |
264 | + for project in projects['repositories']: |
265 | + _git_ensure_key_exists('name', project.keys()) |
266 | + _git_ensure_key_exists('repository', project.keys()) |
267 | + _git_ensure_key_exists('branch', project.keys()) |
268 | + |
269 | + if projects['repositories'][0]['name'] != 'requirements': |
270 | + error_out('{} git repo must be specified first'.format('requirements')) |
271 | + |
272 | + if projects['repositories'][-1]['name'] != core_project: |
273 | + error_out('{} git repo must be specified last'.format(core_project)) |
274 | + |
275 | + |
276 | +def _git_ensure_key_exists(key, keys): |
277 | + """ |
278 | + Ensure that key exists in keys. |
279 | + """ |
280 | + if key not in keys: |
281 | + error_out('openstack-origin-git key \'{}\' is missing'.format(key)) |
282 | + |
283 | + |
284 | +def _git_clone_and_install_single(repo, branch, parent_dir, update_requirements): |
285 | + """ |
286 | + Clone and install a single git repository. |
287 | + """ |
288 | + dest_dir = os.path.join(parent_dir, os.path.basename(repo)) |
289 | + |
290 | + if not os.path.exists(parent_dir): |
291 | + juju_log('Directory already exists at {}. ' |
292 | + 'No need to create directory.'.format(parent_dir)) |
293 | + os.mkdir(parent_dir) |
294 | |
295 | if not os.path.exists(dest_dir): |
296 | juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch)) |
297 | - repo_dir = install_remote(repo, dest=dest_parent_dir, branch=branch) |
298 | + repo_dir = install_remote(repo, dest=parent_dir, branch=branch) |
299 | else: |
300 | repo_dir = dest_dir |
301 | |
302 | @@ -561,16 +593,39 @@ |
303 | |
304 | |
305 | def _git_update_requirements(package_dir, reqs_dir): |
306 | - """Update from global requirements. |
307 | + """ |
308 | + Update from global requirements. |
309 | |
310 | - Update an OpenStack git directory's requirements.txt and |
311 | - test-requirements.txt from global-requirements.txt.""" |
312 | + Update an OpenStack git directory's requirements.txt and |
313 | + test-requirements.txt from global-requirements.txt. |
314 | + """ |
315 | orig_dir = os.getcwd() |
316 | os.chdir(reqs_dir) |
317 | - cmd = "python update.py {}".format(package_dir) |
318 | + cmd = ['python', 'update.py', package_dir] |
319 | try: |
320 | - subprocess.check_call(cmd.split(' ')) |
321 | + subprocess.check_call(cmd) |
322 | except subprocess.CalledProcessError: |
323 | package = os.path.basename(package_dir) |
324 | error_out("Error updating {} from global-requirements.txt".format(package)) |
325 | os.chdir(orig_dir) |
326 | + |
327 | + |
328 | +def git_src_dir(projects_yaml, project): |
329 | + """ |
330 | + Return the directory where the specified project's source is located. |
331 | + """ |
332 | + parent_dir = '/mnt/openstack-git' |
333 | + |
334 | + if not projects_yaml: |
335 | + return |
336 | + |
337 | + projects = yaml.load(projects_yaml) |
338 | + |
339 | + if 'directory' in projects.keys(): |
340 | + parent_dir = projects['directory'] |
341 | + |
342 | + for p in projects['repositories']: |
343 | + if p['name'] == project: |
344 | + return os.path.join(parent_dir, os.path.basename(p['repository'])) |
345 | + |
346 | + return None |
347 | |
348 | === modified file 'hooks/charmhelpers/core/unitdata.py' |
349 | --- hooks/charmhelpers/core/unitdata.py 2015-02-16 11:22:05 +0000 |
350 | +++ hooks/charmhelpers/core/unitdata.py 2015-04-01 14:19:25 +0000 |
351 | @@ -443,7 +443,7 @@ |
352 | data = hookenv.execution_environment() |
353 | self.conf = conf_delta = self.kv.delta(data['conf'], 'config') |
354 | self.rels = rels_delta = self.kv.delta(data['rels'], 'rels') |
355 | - self.kv.set('env', data['env']) |
356 | + self.kv.set('env', dict(data['env'])) |
357 | self.kv.set('unit', data['unit']) |
358 | self.kv.set('relid', data.get('relid')) |
359 | return conf_delta, rels_delta |
360 | |
361 | === modified file 'hooks/neutron_ovs_hooks.py' |
362 | --- hooks/neutron_ovs_hooks.py 2015-04-01 12:53:02 +0000 |
363 | +++ hooks/neutron_ovs_hooks.py 2015-04-01 14:19:25 +0000 |
364 | @@ -19,10 +19,15 @@ |
365 | apt_install, apt_update, apt_purge |
366 | ) |
367 | |
368 | +from charmhelpers.contrib.openstack.utils import ( |
369 | + os_requires_version, |
370 | +) |
371 | + |
372 | from neutron_ovs_utils import ( |
373 | DVR_PACKAGES, |
374 | configure_ovs, |
375 | determine_packages, |
376 | + get_topics, |
377 | determine_dvr_packages, |
378 | get_shared_secret, |
379 | register_configs, |
380 | @@ -51,6 +56,8 @@ |
381 | apt_install(determine_dvr_packages(), fatal=True) |
382 | configure_ovs() |
383 | CONFIGS.write_all() |
384 | + for rid in relation_ids('zeromq-configuration'): |
385 | + zeromq_configuration_relation_joined(rid) |
386 | |
387 | |
388 | @hooks.hook('neutron-plugin-api-relation-changed') |
389 | @@ -94,6 +101,20 @@ |
390 | CONFIGS.write_all() |
391 | |
392 | |
393 | +@hooks.hook('zeromq-configuration-relation-joined') |
394 | +@os_requires_version('kilo', 'neutron-common') |
395 | +def zeromq_configuration_relation_joined(relid=None): |
396 | + relation_set(relation_id=relid, |
397 | + topics=" ".join(get_topics()), |
398 | + users="neutron") |
399 | + |
400 | + |
401 | +@hooks.hook('zeromq-configuration-relation-changed') |
402 | +@restart_on_change(restart_map(), stopstart=True) |
403 | +def zeromq_configuration_relation_changed(): |
404 | + CONFIGS.write_all() |
405 | + |
406 | + |
407 | def main(): |
408 | try: |
409 | hooks.execute(sys.argv) |
410 | |
411 | === modified file 'hooks/neutron_ovs_utils.py' |
412 | --- hooks/neutron_ovs_utils.py 2015-03-31 14:33:06 +0000 |
413 | +++ hooks/neutron_ovs_utils.py 2015-04-01 14:19:25 +0000 |
414 | @@ -44,7 +44,9 @@ |
415 | (NEUTRON_CONF, { |
416 | 'services': ['neutron-plugin-openvswitch-agent'], |
417 | 'contexts': [neutron_ovs_context.OVSPluginContext(), |
418 | - context.AMQPContext(ssl_dir=NEUTRON_CONF_DIR)], |
419 | + context.AMQPContext(ssl_dir=NEUTRON_CONF_DIR), |
420 | + context.ZeroMQContext(), |
421 | + context.NotificationDriverContext()], |
422 | }), |
423 | (ML2_CONF, { |
424 | 'services': ['neutron-plugin-openvswitch-agent'], |
425 | @@ -122,6 +124,18 @@ |
426 | return {k: v['services'] for k, v in resource_map().iteritems()} |
427 | |
428 | |
429 | +def get_topics(): |
430 | + topics = [] |
431 | + topics.append('q-agent-notifier-port-update') |
432 | + topics.append('q-agent-notifier-network-delete') |
433 | + topics.append('q-agent-notifier-tunnel-update') |
434 | + topics.append('q-agent-notifier-security_group-update') |
435 | + topics.append('q-agent-notifier-dvr-update') |
436 | + if context.NeutronAPIContext()()['l2_population']: |
437 | + topics.append('q-agent-notifier-l2population-update') |
438 | + return topics |
439 | + |
440 | + |
441 | def configure_ovs(): |
442 | if not service_running('openvswitch-switch'): |
443 | full_restart() |
444 | |
445 | === added symlink 'hooks/zeromq-configuration-relation-changed' |
446 | === target is u'neutron_ovs_hooks.py' |
447 | === added symlink 'hooks/zeromq-configuration-relation-joined' |
448 | === target is u'neutron_ovs_hooks.py' |
449 | === modified file 'metadata.yaml' |
450 | --- metadata.yaml 2015-03-31 14:33:06 +0000 |
451 | +++ metadata.yaml 2015-04-01 14:19:25 +0000 |
452 | @@ -28,3 +28,7 @@ |
453 | scope: container |
454 | neutron-plugin-api: |
455 | interface: neutron-plugin-api |
456 | + zeromq-configuration: |
457 | + interface: zeromq-configuration |
458 | + scope: container |
459 | + |
460 | |
461 | === modified file 'templates/icehouse/neutron.conf' |
462 | --- templates/icehouse/neutron.conf 2015-03-24 14:51:19 +0000 |
463 | +++ templates/icehouse/neutron.conf 2015-04-01 14:19:25 +0000 |
464 | @@ -21,7 +21,9 @@ |
465 | |
466 | api_paste_config = /etc/neutron/api-paste.ini |
467 | auth_strategy = keystone |
468 | +{% if notifications == 'True' -%} |
469 | notification_driver = neutron.openstack.common.notifier.rpc_notifier |
470 | +{% endif -%} |
471 | default_notification_level = INFO |
472 | notification_topics = notifications |
473 | |
474 | @@ -36,4 +38,3 @@ |
475 | |
476 | [keystone_authtoken] |
477 | signing_dir = /var/lib/neutron/keystone-signing |
478 | - |
479 | |
480 | === modified file 'templates/kilo/neutron.conf' |
481 | --- templates/kilo/neutron.conf 2015-03-25 09:22:37 +0000 |
482 | +++ templates/kilo/neutron.conf 2015-04-01 14:19:25 +0000 |
483 | @@ -24,6 +24,8 @@ |
484 | default_notification_level = INFO |
485 | notification_topics = notifications |
486 | |
487 | +{% include "section-zeromq" %} |
488 | + |
489 | {% include "section-rabbitmq-oslo" %} |
490 | |
491 | [QUOTAS] |
492 | |
493 | === modified file 'tests/charmhelpers/contrib/openstack/amulet/deployment.py' |
494 | --- tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-02-16 12:07:08 +0000 |
495 | +++ tests/charmhelpers/contrib/openstack/amulet/deployment.py 2015-04-01 14:19:25 +0000 |
496 | @@ -15,6 +15,7 @@ |
497 | # along with charm-helpers. If not, see <http://www.gnu.org/licenses/>. |
498 | |
499 | import six |
500 | +from collections import OrderedDict |
501 | from charmhelpers.contrib.amulet.deployment import ( |
502 | AmuletDeployment |
503 | ) |
504 | @@ -100,12 +101,34 @@ |
505 | """ |
506 | (self.precise_essex, self.precise_folsom, self.precise_grizzly, |
507 | self.precise_havana, self.precise_icehouse, |
508 | - self.trusty_icehouse) = range(6) |
509 | + self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8) |
510 | releases = { |
511 | ('precise', None): self.precise_essex, |
512 | ('precise', 'cloud:precise-folsom'): self.precise_folsom, |
513 | ('precise', 'cloud:precise-grizzly'): self.precise_grizzly, |
514 | ('precise', 'cloud:precise-havana'): self.precise_havana, |
515 | ('precise', 'cloud:precise-icehouse'): self.precise_icehouse, |
516 | - ('trusty', None): self.trusty_icehouse} |
517 | + ('trusty', None): self.trusty_icehouse, |
518 | + ('trusty', 'cloud:trusty-juno'): self.trusty_juno, |
519 | + ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo} |
520 | return releases[(self.series, self.openstack)] |
521 | + |
522 | + def _get_openstack_release_string(self): |
523 | + """Get openstack release string. |
524 | + |
525 | + Return a string representing the openstack release. |
526 | + """ |
527 | + releases = OrderedDict([ |
528 | + ('precise', 'essex'), |
529 | + ('quantal', 'folsom'), |
530 | + ('raring', 'grizzly'), |
531 | + ('saucy', 'havana'), |
532 | + ('trusty', 'icehouse'), |
533 | + ('utopic', 'juno'), |
534 | + ('vivid', 'kilo'), |
535 | + ]) |
536 | + if self.openstack: |
537 | + os_origin = self.openstack.split(':')[1] |
538 | + return os_origin.split('%s-' % self.series)[1].split('/')[0] |
539 | + else: |
540 | + return releases[self.series] |
541 | |
542 | === modified file 'unit_tests/test_neutron_ovs_hooks.py' |
543 | --- unit_tests/test_neutron_ovs_hooks.py 2015-03-25 10:31:44 +0000 |
544 | +++ unit_tests/test_neutron_ovs_hooks.py 2015-04-01 14:19:25 +0000 |
545 | @@ -59,8 +59,11 @@ |
546 | ]) |
547 | |
548 | def test_config_changed(self): |
549 | + self.relation_ids.return_value = ['relid'] |
550 | + _zmq_joined = self.patch('zeromq_configuration_relation_joined') |
551 | self._call_hook('config-changed') |
552 | self.assertTrue(self.CONFIGS.write_all.called) |
553 | + self.assertTrue(_zmq_joined.called_with('relid')) |
554 | self.configure_ovs.assert_called_with() |
555 | |
556 | def test_config_changed_dvr(self): |
UOSCI bot says:
This MP triggered a test on the Ubuntu OSCI system. Here is a summary of results.
#692 neutron- openvswitch- next for gnuoy mp238874
charm_lint_check
This build: 10.98.191. 181:8080/ job/charm_ lint_check/ 692/
http://
MP URL: /code.launchpad .net/~openstack -charmers/ charms/ trusty/ neutron- openvswitch/ 0mq/+merge/ 238874
https:/
Proposed branch:
lp:~openstack-charmers/charms/trusty/neutron-openvswitch/0mq
Results summary:
LINT FAIL: lint-check failed
LINT Results (max last 25 lines) from jenkins/ workspace/ charm_lint_ check/make- lint.692: ovs_utils. py:73:1: W391 blank line at end of file
/var/lib/
hooks/neutron_
make: *** [lint] Error 1
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://