Merge lp:~bac/charms/trusty/openstack-dashboard/dashboard-plugin into lp:~openstack-charmers-archive/charms/trusty/openstack-dashboard/next

Proposed by Brad Crittenden
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
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+270177@code.launchpad.net

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/openstack_dashboard. From that information the subordinate can figure out the path to local/enabled for adding dashboard enabling slugs (e.g. _50_mydashboard.py).

To post a comment you must log in.
83. By James Page

[trivial] Resync helpers to pickup liberty version detection

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

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/
Build: http://10.245.162.77:8080/job/charm_lint_check/9387/

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

charm_unit_test #8682 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_lint_check #9389 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/9389/

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

charm_unit_test #8684 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_amulet_test #6251 openstack-dashboard-next for bac mp270177
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6251/

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

charm_amulet_test #6253 openstack-dashboard-next for bac mp270177
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6253/

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

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

charm_lint_check #10965 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/10965/

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

charm_amulet_test #6858 openstack-dashboard-next for bac mp270177
    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://paste.ubuntu.com/12606204/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6858/

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

charm_unit_test #10235 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_lint_check #11025 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11025/

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

charm_amulet_test #6874 openstack-dashboard-next for bac mp270177
    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://paste.ubuntu.com/12612946/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6874/

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

See inline comment

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

charm_lint_check #11091 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11091/

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

charm_unit_test #10299 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_amulet_test #6897 openstack-dashboard-next for bac mp270177
    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://paste.ubuntu.com/12625976/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6897/

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

charm_lint_check #11097 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11097/

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

charm_unit_test #10305 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_amulet_test #6907 openstack-dashboard-next for bac mp270177
    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://paste.ubuntu.com/12627583/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6907/

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

charm_lint_check #11150 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11150/

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

charm_unit_test #10355 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_unit_test #10357 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_lint_check #11155 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11155/

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

charm_amulet_test #6927 openstack-dashboard-next for bac mp270177
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6927/

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

charm_amulet_test #6932 openstack-dashboard-next for bac mp270177
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6932/

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

charm_amulet_test #7030 openstack-dashboard-next for bac mp270177
    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://paste.ubuntu.com/12645015/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7030/

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

charm_lint_check #11329 openstack-dashboard-next for bac mp270177
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11329/

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

charm_unit_test #10523 openstack-dashboard-next for bac mp270177
    UNIT OK: passed

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

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

charm_amulet_test #7115 openstack-dashboard-next for bac mp270177
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/7115/

Revision history for this message
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.

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

approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/horizon_hooks.py'
--- hooks/horizon_hooks.py 2015-09-24 16:32:05 +0000
+++ hooks/horizon_hooks.py 2015-10-05 18:31:20 +0000
@@ -24,6 +24,7 @@
24 config_value_changed,24 config_value_changed,
25 configure_installation_source,25 configure_installation_source,
26 git_install_requested,26 git_install_requested,
27 git_pip_venv_dir,
27 openstack_upgrade_available,28 openstack_upgrade_available,
28 os_release,29 os_release,
29 save_script_rc30 save_script_rc
@@ -38,7 +39,8 @@
38 do_openstack_upgrade,39 do_openstack_upgrade,
39 git_install,40 git_install,
40 git_post_install_late,41 git_post_install_late,
41 setup_ipv642 setup_ipv6,
43 INSTALL_DIR
42)44)
43from charmhelpers.contrib.network.ip import (45from charmhelpers.contrib.network.ip import (
44 get_iface_for_address,46 get_iface_for_address,
@@ -245,8 +247,15 @@
245247
246248
247@hooks.hook('dashboard-plugin-relation-joined')249@hooks.hook('dashboard-plugin-relation-joined')
248def plugin_relation_joined():250def plugin_relation_joined(rel_id=None):
249 relation_set(release=os_release("openstack-dashboard"))251 if git_install_requested():
252 bin_path = git_pip_venv_dir(config('openstack-origin-git'))
253 else:
254 bin_path = '/usr/bin'
255 relation_set(release=os_release("openstack-dashboard"),
256 relation_id=rel_id,
257 bin_path=bin_path,
258 openstack_dir=INSTALL_DIR)
250259
251260
252@hooks.hook('dashboard-plugin-relation-changed')261@hooks.hook('dashboard-plugin-relation-changed')
253262
=== modified file 'hooks/horizon_utils.py'
--- hooks/horizon_utils.py 2015-09-24 16:31:59 +0000
+++ hooks/horizon_utils.py 2015-10-05 18:31:20 +0000
@@ -91,6 +91,7 @@
91APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR)91APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR)
92APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR)92APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR)
93APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR)93APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR)
94INSTALL_DIR = "/usr/share/openstack-dashboard"
94ROUTER_SETTING = \95ROUTER_SETTING = \
95 "/usr/share/openstack-dashboard/openstack_dashboard/enabled/_40_router.py"96 "/usr/share/openstack-dashboard/openstack_dashboard/enabled/_40_router.py"
9697
9798
=== modified file 'metadata.yaml'
--- metadata.yaml 2015-09-12 10:58:20 +0000
+++ metadata.yaml 2015-10-05 18:31:20 +0000
@@ -13,15 +13,15 @@
13 scope: container13 scope: container
14 website:14 website:
15 interface: http15 interface: http
16 dashboard-plugin:
17 interface: dashboard-plugin
18 scope: container
16requires:19requires:
17 identity-service:20 identity-service:
18 interface: keystone21 interface: keystone
19 ha:22 ha:
20 interface: hacluster23 interface: hacluster
21 scope: container24 scope: container
22 dashboard-plugin:
23 interface: dashboard-plugin
24 scope: container
25peers:25peers:
26 cluster:26 cluster:
27 interface: openstack-dashboard-ha27 interface: openstack-dashboard-ha
2828
=== modified file 'unit_tests/test_horizon_hooks.py'
--- unit_tests/test_horizon_hooks.py 2015-08-27 15:02:34 +0000
+++ unit_tests/test_horizon_hooks.py 2015-10-05 18:31:20 +0000
@@ -308,6 +308,37 @@
308 self._call_hook('website-relation-joined')308 self._call_hook('website-relation-joined')
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')
310310
311 @patch.object(hooks, 'os_release')
312 @patch.object(hooks, 'git_install_requested')
313 def test_dashboard_config_joined_not_git(
314 self, _git_requested, _os_release):
315 _git_requested.return_value = False
316 _os_release.return_value = 'vivid'
317 self._call_hook('dashboard-plugin-relation-joined')
318 self.relation_set.assert_called_with(
319 release='vivid',
320 bin_path='/usr/bin',
321 openstack_dir='/usr/share/openstack-dashboard',
322 relation_id=None
323 )
324
325 @patch.object(hooks, 'os_release')
326 @patch.object(hooks, 'git_pip_venv_dir')
327 @patch.object(hooks, 'git_install_requested')
328 def test_dashboard_config_joined_git(
329 self, _git_requested, _git_pip_venv_dir, _os_release):
330 expected_bin_path = '/mnt/fuji/venv'
331 _git_requested.return_value = True
332 _git_pip_venv_dir.return_value = expected_bin_path
333 _os_release.return_value = 'wily'
334 self._call_hook('dashboard-plugin-relation-joined')
335 self.relation_set.assert_called_with(
336 release='wily',
337 bin_path=expected_bin_path,
338 openstack_dir='/usr/share/openstack-dashboard',
339 relation_id=None
340 )
341
311 @patch('sys.argv')342 @patch('sys.argv')
312 @patch.object(hooks, 'install')343 @patch.object(hooks, 'install')
313 def test_main_hook_exists(self, _install, _argv):344 def test_main_hook_exists(self, _install, _argv):

Subscribers

People subscribed via source and target branches