Merge lp:~bac/charms/trusty/openstack-dashboard/dashboard-plugin into lp:~openstack-charmers-archive/charms/trusty/openstack-dashboard/next
- Trusty Tahr (14.04)
- dashboard-plugin
- Merge into next
Status: | Merged |
---|---|
Merged at revision: | 90 |
Proposed branch: | lp:~bac/charms/trusty/openstack-dashboard/dashboard-plugin |
Merge into: | lp:~openstack-charmers-archive/charms/trusty/openstack-dashboard/next |
Diff against target: |
116 lines (+47/-6) 4 files modified
hooks/horizon_hooks.py (+12/-3) hooks/horizon_utils.py (+1/-0) metadata.yaml (+3/-3) unit_tests/test_horizon_hooks.py (+31/-0) |
To merge this branch: | bzr merge lp:~bac/charms/trusty/openstack-dashboard/dashboard-plugin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Liam Young (community) | Approve | ||
Review via email: mp+270177@code.launchpad.net |
Commit message
Description of the change
This branch adds a new relation 'dashboard-plugin' for openstack-dashboard to communicate to subordinate plugin charms details about the installation so the plugin can insert itself.
Currently the two pieces of information sent via the relationship are bin_path and openstack_dir.
The bin_path can be different based on how openstack is installed by the charm. If installed via distro or cloud-archive, a debian package is used to install openstack and the system python libraries are modified. If installed via git source then a virtual environment is used. If a subordinate charm needs to install python packages via pip then it needs to know which pip to use. bin_path specifies the correct environment to use, either /usr/bin or the result of git_pip_venv_dir.
openstack_dir provides the path to where openstack is installed. Currently it is always /usr/share/
- 83. By James Page
-
[trivial] Resync helpers to pickup liberty version detection
uosci-testing-bot (uosci-testing-bot) wrote : | # |
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #8682 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #9389 openstack-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #8684 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6251 openstack-
AMULET OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6253 openstack-
AMULET OK: passed
Build: http://
- 84. By James Page
-
[1chb1n,
r=james- page] Update tests for T-K, V-K, prep for T-L and W-L. Clean up old lint. Resolve bug 1474030 race in svc restart checks.
- 85. By Brad Crittenden
-
Add dashboard-plugin relation
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #10965 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6858 openstack-
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #10235 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #11025 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6874 openstack-
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
Liam Young (gnuoy) wrote : | # |
See inline comment
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #11091 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #10299 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6897 openstack-
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 124
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #11097 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #10305 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6907 openstack-
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 124
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #11150 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #10355 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #10357 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #11155 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6927 openstack-
AMULET OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #6932 openstack-
AMULET OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #7030 openstack-
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #11329 openstack-
LINT OK: passed
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #10523 openstack-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #7115 openstack-
AMULET OK: passed
Build: http://
Brad Crittenden (bac) wrote : | # |
Liam I have made the change you requested and now have all tests passing since the problem with CI was resolved. Please take another look and let me know how we can get this merged.
Preview Diff
1 | === modified file 'hooks/horizon_hooks.py' | |||
2 | --- hooks/horizon_hooks.py 2015-09-24 16:32:05 +0000 | |||
3 | +++ hooks/horizon_hooks.py 2015-10-05 18:31:20 +0000 | |||
4 | @@ -24,6 +24,7 @@ | |||
5 | 24 | config_value_changed, | 24 | config_value_changed, |
6 | 25 | configure_installation_source, | 25 | configure_installation_source, |
7 | 26 | git_install_requested, | 26 | git_install_requested, |
8 | 27 | git_pip_venv_dir, | ||
9 | 27 | openstack_upgrade_available, | 28 | openstack_upgrade_available, |
10 | 28 | os_release, | 29 | os_release, |
11 | 29 | save_script_rc | 30 | save_script_rc |
12 | @@ -38,7 +39,8 @@ | |||
13 | 38 | do_openstack_upgrade, | 39 | do_openstack_upgrade, |
14 | 39 | git_install, | 40 | git_install, |
15 | 40 | git_post_install_late, | 41 | git_post_install_late, |
17 | 41 | setup_ipv6 | 42 | setup_ipv6, |
18 | 43 | INSTALL_DIR | ||
19 | 42 | ) | 44 | ) |
20 | 43 | from charmhelpers.contrib.network.ip import ( | 45 | from charmhelpers.contrib.network.ip import ( |
21 | 44 | get_iface_for_address, | 46 | get_iface_for_address, |
22 | @@ -245,8 +247,15 @@ | |||
23 | 245 | 247 | ||
24 | 246 | 248 | ||
25 | 247 | @hooks.hook('dashboard-plugin-relation-joined') | 249 | @hooks.hook('dashboard-plugin-relation-joined') |
28 | 248 | def plugin_relation_joined(): | 250 | def plugin_relation_joined(rel_id=None): |
29 | 249 | relation_set(release=os_release("openstack-dashboard")) | 251 | if git_install_requested(): |
30 | 252 | bin_path = git_pip_venv_dir(config('openstack-origin-git')) | ||
31 | 253 | else: | ||
32 | 254 | bin_path = '/usr/bin' | ||
33 | 255 | relation_set(release=os_release("openstack-dashboard"), | ||
34 | 256 | relation_id=rel_id, | ||
35 | 257 | bin_path=bin_path, | ||
36 | 258 | openstack_dir=INSTALL_DIR) | ||
37 | 250 | 259 | ||
38 | 251 | 260 | ||
39 | 252 | @hooks.hook('dashboard-plugin-relation-changed') | 261 | @hooks.hook('dashboard-plugin-relation-changed') |
40 | 253 | 262 | ||
41 | === modified file 'hooks/horizon_utils.py' | |||
42 | --- hooks/horizon_utils.py 2015-09-24 16:31:59 +0000 | |||
43 | +++ hooks/horizon_utils.py 2015-10-05 18:31:20 +0000 | |||
44 | @@ -91,6 +91,7 @@ | |||
45 | 91 | APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR) | 91 | APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR) |
46 | 92 | APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR) | 92 | APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR) |
47 | 93 | APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR) | 93 | APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR) |
48 | 94 | INSTALL_DIR = "/usr/share/openstack-dashboard" | ||
49 | 94 | ROUTER_SETTING = \ | 95 | ROUTER_SETTING = \ |
50 | 95 | "/usr/share/openstack-dashboard/openstack_dashboard/enabled/_40_router.py" | 96 | "/usr/share/openstack-dashboard/openstack_dashboard/enabled/_40_router.py" |
51 | 96 | 97 | ||
52 | 97 | 98 | ||
53 | === modified file 'metadata.yaml' | |||
54 | --- metadata.yaml 2015-09-12 10:58:20 +0000 | |||
55 | +++ metadata.yaml 2015-10-05 18:31:20 +0000 | |||
56 | @@ -13,15 +13,15 @@ | |||
57 | 13 | scope: container | 13 | scope: container |
58 | 14 | website: | 14 | website: |
59 | 15 | interface: http | 15 | interface: http |
60 | 16 | dashboard-plugin: | ||
61 | 17 | interface: dashboard-plugin | ||
62 | 18 | scope: container | ||
63 | 16 | requires: | 19 | requires: |
64 | 17 | identity-service: | 20 | identity-service: |
65 | 18 | interface: keystone | 21 | interface: keystone |
66 | 19 | ha: | 22 | ha: |
67 | 20 | interface: hacluster | 23 | interface: hacluster |
68 | 21 | scope: container | 24 | scope: container |
69 | 22 | dashboard-plugin: | ||
70 | 23 | interface: dashboard-plugin | ||
71 | 24 | scope: container | ||
72 | 25 | peers: | 25 | peers: |
73 | 26 | cluster: | 26 | cluster: |
74 | 27 | interface: openstack-dashboard-ha | 27 | interface: openstack-dashboard-ha |
75 | 28 | 28 | ||
76 | === modified file 'unit_tests/test_horizon_hooks.py' | |||
77 | --- unit_tests/test_horizon_hooks.py 2015-08-27 15:02:34 +0000 | |||
78 | +++ unit_tests/test_horizon_hooks.py 2015-10-05 18:31:20 +0000 | |||
79 | @@ -308,6 +308,37 @@ | |||
80 | 308 | self._call_hook('website-relation-joined') | 308 | self._call_hook('website-relation-joined') |
81 | 309 | self.relation_set.assert_called_with(port=70, hostname='192.168.1.1') | 309 | self.relation_set.assert_called_with(port=70, hostname='192.168.1.1') |
82 | 310 | 310 | ||
83 | 311 | @patch.object(hooks, 'os_release') | ||
84 | 312 | @patch.object(hooks, 'git_install_requested') | ||
85 | 313 | def test_dashboard_config_joined_not_git( | ||
86 | 314 | self, _git_requested, _os_release): | ||
87 | 315 | _git_requested.return_value = False | ||
88 | 316 | _os_release.return_value = 'vivid' | ||
89 | 317 | self._call_hook('dashboard-plugin-relation-joined') | ||
90 | 318 | self.relation_set.assert_called_with( | ||
91 | 319 | release='vivid', | ||
92 | 320 | bin_path='/usr/bin', | ||
93 | 321 | openstack_dir='/usr/share/openstack-dashboard', | ||
94 | 322 | relation_id=None | ||
95 | 323 | ) | ||
96 | 324 | |||
97 | 325 | @patch.object(hooks, 'os_release') | ||
98 | 326 | @patch.object(hooks, 'git_pip_venv_dir') | ||
99 | 327 | @patch.object(hooks, 'git_install_requested') | ||
100 | 328 | def test_dashboard_config_joined_git( | ||
101 | 329 | self, _git_requested, _git_pip_venv_dir, _os_release): | ||
102 | 330 | expected_bin_path = '/mnt/fuji/venv' | ||
103 | 331 | _git_requested.return_value = True | ||
104 | 332 | _git_pip_venv_dir.return_value = expected_bin_path | ||
105 | 333 | _os_release.return_value = 'wily' | ||
106 | 334 | self._call_hook('dashboard-plugin-relation-joined') | ||
107 | 335 | self.relation_set.assert_called_with( | ||
108 | 336 | release='wily', | ||
109 | 337 | bin_path=expected_bin_path, | ||
110 | 338 | openstack_dir='/usr/share/openstack-dashboard', | ||
111 | 339 | relation_id=None | ||
112 | 340 | ) | ||
113 | 341 | |||
114 | 311 | @patch('sys.argv') | 342 | @patch('sys.argv') |
115 | 312 | @patch.object(hooks, 'install') | 343 | @patch.object(hooks, 'install') |
116 | 313 | def test_main_hook_exists(self, _install, _argv): | 344 | def test_main_hook_exists(self, _install, _argv): |
charm_lint_check #9387 openstack- dashboard- next for bac mp270177
LINT FAIL: lint-test failed
LINT Results (max last 2 lines):
make: *** [lint] Error 1
ERROR:root:Make target returned non-zero.
Full lint test output: http:// paste.ubuntu. com/12273326/ 10.245. 162.77: 8080/job/ charm_lint_ check/9387/
Build: http://