Merge lp:~hopem/charms/trusty/nova-cloud-controller/lp1464605 into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 167
Proposed branch: lp:~hopem/charms/trusty/nova-cloud-controller/lp1464605
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 85 lines (+19/-4)
2 files modified
hooks/nova_cc_hooks.py (+6/-1)
unit_tests/test_nova_cc_hooks.py (+13/-3)
To merge this branch: bzr merge lp:~hopem/charms/trusty/nova-cloud-controller/lp1464605
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+261845@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #5347 nova-cloud-controller-next for hopem mp261845
    LINT OK: passed

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

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

charm_unit_test #4979 nova-cloud-controller-next for hopem mp261845
    UNIT OK: passed

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

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

charm_amulet_test #4588 nova-cloud-controller-next for hopem mp261845
    AMULET OK: passed

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_cc_hooks.py'
2--- hooks/nova_cc_hooks.py 2015-06-10 15:48:34 +0000
3+++ hooks/nova_cc_hooks.py 2015-06-12 13:06:16 +0000
4@@ -190,9 +190,14 @@
5 if console_attributes('protocol'):
6 if not git_install_requested():
7 apt_update()
8- apt_install(console_attributes('packages'), fatal=True)
9+ packages = console_attributes('packages') or []
10+ filtered = filter_installed_packages(packages)
11+ if filtered:
12+ apt_install(filtered, fatal=True)
13+
14 [compute_joined(rid=rid)
15 for rid in relation_ids('cloud-compute')]
16+
17 for r_id in relation_ids('identity-service'):
18 identity_joined(rid=r_id)
19 for rid in relation_ids('zeromq-configuration'):
20
21=== modified file 'unit_tests/test_nova_cc_hooks.py'
22--- unit_tests/test_nova_cc_hooks.py 2015-06-11 13:33:42 +0000
23+++ unit_tests/test_nova_cc_hooks.py 2015-06-12 13:06:16 +0000
24@@ -145,12 +145,14 @@
25 self.disable_services.assert_called()
26 self.cmd_all_services.assert_called_with('stop')
27
28+ @patch.object(hooks, 'filter_installed_packages')
29 @patch.object(hooks, 'configure_https')
30- def test_config_changed_no_upgrade(self, conf_https):
31+ def test_config_changed_no_upgrade(self, conf_https, mock_filter_packages):
32 self.git_install_requested.return_value = False
33 self.openstack_upgrade_available.return_value = False
34 hooks.config_changed()
35 self.assertTrue(self.save_script_rc.called)
36+ mock_filter_packages.assert_called_with([])
37
38 @patch.object(hooks, 'config_value_changed')
39 @patch.object(hooks, 'configure_https')
40@@ -176,6 +178,7 @@
41 self.git_install.assert_called_with(projects_yaml)
42 self.assertFalse(self.do_openstack_upgrade.called)
43
44+ @patch.object(hooks, 'filter_installed_packages')
45 @patch('charmhelpers.contrib.openstack.ip.service_name',
46 lambda *args: 'nova-cloud-controller')
47 @patch.object(hooks, 'cluster_joined')
48@@ -183,7 +186,8 @@
49 @patch.object(hooks, 'neutron_api_relation_joined')
50 @patch.object(hooks, 'configure_https')
51 def test_config_changed_with_upgrade(self, conf_https, neutron_api_joined,
52- identity_joined, cluster_joined):
53+ identity_joined, cluster_joined,
54+ mock_filter_packages):
55 self.git_install_requested.return_value = False
56 self.openstack_upgrade_available.return_value = True
57 self.relation_ids.return_value = ['generic_rid']
58@@ -195,6 +199,7 @@
59 self.assertTrue(_zmq_joined.called)
60 self.assertTrue(cluster_joined.called)
61 self.assertTrue(self.save_script_rc.called)
62+ mock_filter_packages.assert_called_with([])
63
64 def test_compute_changed_ssh_migration(self):
65 self.test_relation.set({
66@@ -820,9 +825,12 @@
67 call(**args),
68 ])
69
70+ @patch.object(hooks, 'filter_installed_packages')
71 @patch('nova_cc_hooks.configure_https')
72 @patch('nova_cc_utils.config')
73- def test_config_changed_single_consoleauth(self, config, *args):
74+ def test_config_changed_single_consoleauth(self, mock_config,
75+ mock_configure_https,
76+ mock_filter_packages):
77 self.git_install_requested.return_value = False
78 config.return_value = 'novnc'
79 rids = {'ha': ['ha:1']}
80@@ -846,3 +854,5 @@
81 self.relation_set.assert_has_calls([
82 call(v, **args) for v in rids['ha']
83 ])
84+
85+ mock_filter_packages.assert_called_with([])

Subscribers

People subscribed via source and target branches