summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrode Nordahl <frode.nordahl@canonical.com>2018-04-19 18:38:48 +0200
committerFrode Nordahl <frode.nordahl@canonical.com>2018-04-20 19:10:59 +0200
commitedc18d4937807dbe2934580449182d65cd642f53 (patch)
tree32c46cc29a31354f21f9fa643433ceca3900a504
parent794b8ed0bb9f908ca7c12362cdcba6c3b24f5dc8 (diff)
Make charm agnostic of underlying init system
Replace charm custom init control functions with `service_pause` and `service_resume` functions from charm-helpers. Change-Id: I235af30a19294316f65fba0e13fe10ae50164a42 Closes-Bug: #1765215
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+2: Liam Young <liam.young@canonical.com> Workflow+1: Liam Young <liam.young@canonical.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 23 Apr 2018 06:54:31 +0000 Reviewed-on: https://review.openstack.org/562741 Project: openstack/charm-nova-cloud-controller Branch: refs/heads/master
-rwxr-xr-xhooks/nova_cc_hooks.py54
-rw-r--r--hooks/nova_cc_utils.py37
-rw-r--r--unit_tests/test_nova_cc_hooks.py68
-rw-r--r--unit_tests/test_nova_cc_utils.py30
4 files changed, 122 insertions, 67 deletions
diff --git a/hooks/nova_cc_hooks.py b/hooks/nova_cc_hooks.py
index 48e1cba..0e3c731 100755
--- a/hooks/nova_cc_hooks.py
+++ b/hooks/nova_cc_hooks.py
@@ -46,8 +46,9 @@ from charmhelpers.core.hookenv import (
46) 46)
47 47
48from charmhelpers.core.host import ( 48from charmhelpers.core.host import (
49 service_reload,
50 service_pause, 49 service_pause,
50 service_reload,
51 service_resume,
51) 52)
52 53
53from charmhelpers.fetch import ( 54from charmhelpers.fetch import (
@@ -84,14 +85,11 @@ from charmhelpers.contrib.peerstorage import (
84from nova_cc_utils import ( 85from nova_cc_utils import (
85 add_hosts_to_cell, 86 add_hosts_to_cell,
86 auth_token_config, 87 auth_token_config,
87 cmd_all_services,
88 determine_endpoints, 88 determine_endpoints,
89 determine_packages, 89 determine_packages,
90 determine_ports, 90 determine_ports,
91 disable_package_apache_site, 91 disable_package_apache_site,
92 disable_services,
93 do_openstack_upgrade, 92 do_openstack_upgrade,
94 enable_services,
95 is_api_ready, 93 is_api_ready,
96 is_cellv2_init_ready, 94 is_cellv2_init_ready,
97 keystone_ca_cert_b64, 95 keystone_ca_cert_b64,
@@ -159,7 +157,6 @@ CONFIGS = register_configs()
159COLO_CONSOLEAUTH = 'inf: res_nova_consoleauth grp_nova_vips' 157COLO_CONSOLEAUTH = 'inf: res_nova_consoleauth grp_nova_vips'
160AGENT_CONSOLEAUTH = 'ocf:openstack:nova-consoleauth' 158AGENT_CONSOLEAUTH = 'ocf:openstack:nova-consoleauth'
161AGENT_CA_PARAMS = 'op monitor interval="5s"' 159AGENT_CA_PARAMS = 'op monitor interval="5s"'
162NOVA_CONSOLEAUTH_OVERRIDE = '/etc/init/nova-consoleauth.override'
163 160
164 161
165def leader_init_db_if_ready(skip_acl_check=False, skip_cells_restarts=False, 162def leader_init_db_if_ready(skip_acl_check=False, skip_cells_restarts=False,
@@ -273,8 +270,11 @@ def install():
273 msg = 'Disabling services into db relation joined' 270 msg = 'Disabling services into db relation joined'
274 log(msg) 271 log(msg)
275 status_set('maintenance', msg) 272 status_set('maintenance', msg)
276 disable_services() 273 if not is_unit_paused_set():
277 cmd_all_services('stop') 274 for svc in services():
275 service_pause(svc)
276 else:
277 log('Unit is in paused state, not issuing stop/pause to all services')
278 278
279 279
280@hooks.hook('config-changed') 280@hooks.hook('config-changed')
@@ -287,8 +287,11 @@ def config_changed():
287 # which will subsequently cause db migrations to fail if >= juno. 287 # which will subsequently cause db migrations to fail if >= juno.
288 # Disable neutron-server if >= juno 288 # Disable neutron-server if >= juno
289 if CompareOpenStackReleases(os_release('nova-common')) >= 'juno': 289 if CompareOpenStackReleases(os_release('nova-common')) >= 'juno':
290 with open('/etc/init/neutron-server.override', 'wb') as out: 290 try:
291 out.write('manual\n') 291 service_pause('neutron-server')
292 except ValueError:
293 # neutron-server service not installed, ignore.
294 pass
292 if config('prefer-ipv6'): 295 if config('prefer-ipv6'):
293 status_set('maintenance', 'configuring ipv6') 296 status_set('maintenance', 'configuring ipv6')
294 setup_ipv6() 297 setup_ipv6()
@@ -765,12 +768,21 @@ def cluster_changed():
765 peer_echo(includes=['dbsync_state']) 768 peer_echo(includes=['dbsync_state'])
766 dbsync_state = peer_retrieve('dbsync_state') 769 dbsync_state = peer_retrieve('dbsync_state')
767 if dbsync_state == 'complete': 770 if dbsync_state == 'complete':
768 enable_services() 771 if not is_unit_paused_set():
769 cmd_all_services('start') 772 for svc in services():
773 service_resume(svc)
774 else:
775 log('Unit is in paused state, not issuing start/resume to all '
776 'services')
770 else: 777 else:
771 log('Database sync not ready. Shutting down services') 778 if not is_unit_paused_set():
772 disable_services() 779 log('Database sync not ready. Shutting down services')
773 cmd_all_services('stop') 780 for svc in services():
781 service_pause(svc)
782 else:
783 log('Database sync not ready. Would shut down services but '
784 'unit is in paused state, not issuing stop/pause to all '
785 'services')
774 786
775 787
776@hooks.hook('ha-relation-joined') 788@hooks.hook('ha-relation-joined')
@@ -874,8 +886,12 @@ def db_departed():
874 update_cell_db_if_ready(skip_acl_check=True) 886 update_cell_db_if_ready(skip_acl_check=True)
875 for r_id in relation_ids('cluster'): 887 for r_id in relation_ids('cluster'):
876 relation_set(relation_id=r_id, dbsync_state='incomplete') 888 relation_set(relation_id=r_id, dbsync_state='incomplete')
877 disable_services() 889 if not is_unit_paused_set():
878 cmd_all_services('stop') 890 for svc in services():
891 service_pause(svc)
892 else:
893 log('Unit is in paused state, not issuing stop/pause to all '
894 'services')
879 895
880 896
881@hooks.hook('amqp-relation-broken', 897@hooks.hook('amqp-relation-broken',
@@ -1120,10 +1136,7 @@ def update_nova_consoleauth_config():
1120 for rid in relation_ids('ha'): 1136 for rid in relation_ids('ha'):
1121 relation_set(rid, **data) 1137 relation_set(rid, **data)
1122 1138
1123 try: 1139 service_resume('nova-consoleauth')
1124 os.remove(NOVA_CONSOLEAUTH_OVERRIDE)
1125 except FileNotFoundError as e:
1126 log(str(e), level='DEBUG')
1127 1140
1128 1141
1129def nova_api_relation_joined(rid=None): 1142def nova_api_relation_joined(rid=None):
@@ -1146,5 +1159,6 @@ def main():
1146 log('Unknown hook {} - skipping.'.format(e)) 1159 log('Unknown hook {} - skipping.'.format(e))
1147 assess_status(CONFIGS) 1160 assess_status(CONFIGS)
1148 1161
1162
1149if __name__ == '__main__': 1163if __name__ == '__main__':
1150 main() 1164 main()
diff --git a/hooks/nova_cc_utils.py b/hooks/nova_cc_utils.py
index 3ccde73..48cd34d 100644
--- a/hooks/nova_cc_utils.py
+++ b/hooks/nova_cc_utils.py
@@ -75,7 +75,6 @@ from charmhelpers.core.hookenv import (
75) 75)
76 76
77from charmhelpers.core.host import ( 77from charmhelpers.core.host import (
78 service,
79 service_pause, 78 service_pause,
80 service_resume, 79 service_resume,
81 service_running, 80 service_running,
@@ -493,6 +492,7 @@ def get_step_upgrade_source(new_src):
493 492
494 return None 493 return None
495 494
495
496POLICY_RC_D = """#!/bin/bash 496POLICY_RC_D = """#!/bin/bash
497 497
498set -e 498set -e
@@ -831,8 +831,12 @@ def finalize_migrate_nova_databases():
831 log('Informing peers that dbsync is complete', level=INFO) 831 log('Informing peers that dbsync is complete', level=INFO)
832 peer_store('dbsync_state', 'complete') 832 peer_store('dbsync_state', 'complete')
833 log('Enabling services', level=INFO) 833 log('Enabling services', level=INFO)
834 enable_services() 834 if not is_unit_paused_set():
835 cmd_all_services('start') 835 for svc in services():
836 service_resume(svc)
837 else:
838 log('Unit is in paused state, not issuing start/resume to all '
839 'services')
836 840
837 841
838# NOTE(jamespage): Retry deals with sync issues during one-shot HA deploys. 842# NOTE(jamespage): Retry deals with sync issues during one-shot HA deploys.
@@ -1170,33 +1174,6 @@ def service_guard(guard_map, contexts, active=False):
1170 return wrap 1174 return wrap
1171 1175
1172 1176
1173def cmd_all_services(cmd):
1174 if is_unit_paused_set():
1175 log('Unit is in paused state, not issuing {} to all'
1176 'services'.format(cmd))
1177 return
1178 if cmd == 'start':
1179 for svc in services():
1180 if not service_running(svc):
1181 service_start(svc)
1182 else:
1183 for svc in services():
1184 service(cmd, svc)
1185
1186
1187def disable_services():
1188 for svc in services():
1189 with open('/etc/init/{}.override'.format(svc), 'wb') as out:
1190 out.write('exec true\n')
1191
1192
1193def enable_services():
1194 for svc in services():
1195 override_file = '/etc/init/{}.override'.format(svc)
1196 if os.path.isfile(override_file):
1197 os.remove(override_file)
1198
1199
1200def setup_ipv6(): 1177def setup_ipv6():
1201 ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower() 1178 ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower()
1202 if CompareHostReleases(ubuntu_rel) < "trusty": 1179 if CompareHostReleases(ubuntu_rel) < "trusty":
diff --git a/unit_tests/test_nova_cc_hooks.py b/unit_tests/test_nova_cc_hooks.py
index 8c8a376..b9c9893 100644
--- a/unit_tests/test_nova_cc_hooks.py
+++ b/unit_tests/test_nova_cc_hooks.py
@@ -48,17 +48,15 @@ TO_PATCH = [
48 'charm_dir', 48 'charm_dir',
49 'do_openstack_upgrade', 49 'do_openstack_upgrade',
50 'openstack_upgrade_available', 50 'openstack_upgrade_available',
51 'cmd_all_services',
52 'config', 51 'config',
53 'config_value_changed', 52 'config_value_changed',
54 'determine_endpoints', 53 'determine_endpoints',
55 'determine_packages', 54 'determine_packages',
56 'determine_ports', 55 'determine_ports',
57 'disable_services',
58 'enable_services',
59 'NovaCellContext', 56 'NovaCellContext',
60 'open_port', 57 'open_port',
61 'is_relation_made', 58 'is_relation_made',
59 'is_unit_paused_set',
62 'local_unit', 60 'local_unit',
63 'log', 61 'log',
64 'os_release', 62 'os_release',
@@ -71,7 +69,9 @@ TO_PATCH = [
71 'ssh_known_hosts_lines', 69 'ssh_known_hosts_lines',
72 'ssh_authorized_keys_lines', 70 'ssh_authorized_keys_lines',
73 'save_script_rc', 71 'save_script_rc',
72 'service_pause',
74 'service_reload', 73 'service_reload',
74 'service_resume',
75 'services', 75 'services',
76 'execd_preinstall', 76 'execd_preinstall',
77 'network_manager', 77 'network_manager',
@@ -129,12 +129,13 @@ class NovaCCHooksTests(CharmTestCase):
129 self.determine_packages.return_value = [ 129 self.determine_packages.return_value = [
130 'nova-scheduler', 'nova-api-ec2'] 130 'nova-scheduler', 'nova-api-ec2']
131 self.determine_ports.return_value = [80, 81, 82] 131 self.determine_ports.return_value = [80, 81, 82]
132 self.is_unit_paused_set.return_value = False
133 self.services.return_value = ['dummy-service']
132 hooks.install() 134 hooks.install()
133 self.apt_install.assert_called_with( 135 self.apt_install.assert_called_with(
134 ['nova-scheduler', 'nova-api-ec2'], fatal=True) 136 ['nova-scheduler', 'nova-api-ec2'], fatal=True)
135 self.assertTrue(self.execd_preinstall.called) 137 self.assertTrue(self.execd_preinstall.called)
136 self.assertTrue(self.disable_services.called) 138 self.assertTrue(self.service_pause.called)
137 self.cmd_all_services.assert_called_with('stop')
138 139
139 @patch.object(hooks, 'update_aws_compat_services') 140 @patch.object(hooks, 'update_aws_compat_services')
140 @patch.object(hooks, 'update_nova_consoleauth_config') 141 @patch.object(hooks, 'update_nova_consoleauth_config')
@@ -165,6 +166,63 @@ class NovaCCHooksTests(CharmTestCase):
165 @patch.object(hooks, 'update_aws_compat_services') 166 @patch.object(hooks, 'update_aws_compat_services')
166 @patch.object(hooks, 'update_nova_consoleauth_config') 167 @patch.object(hooks, 'update_nova_consoleauth_config')
167 @patch.object(hooks, 'is_db_initialised') 168 @patch.object(hooks, 'is_db_initialised')
169 @patch.object(hooks, 'determine_packages')
170 @patch.object(utils, 'service_resume')
171 @patch.object(utils, 'config')
172 @patch.object(hooks, 'filter_installed_packages')
173 @patch.object(hooks, 'configure_https')
174 def test_config_changed_no_upgrade_juno(self, conf_https,
175 mock_filter_packages,
176 utils_config, mock_service_resume,
177 mock_determine_packages,
178 mock_is_db_initialised,
179 mock_update_nova_consoleauth_cfg,
180 mock_update_aws_compat_services):
181 mock_determine_packages.return_value = []
182 utils_config.side_effect = self.test_config.get
183 self.test_config.set('console-access-protocol', 'dummy')
184 self.openstack_upgrade_available.return_value = False
185 mock_is_db_initialised.return_value = False
186 self.os_release.return_value = 'juno'
187 hooks.config_changed()
188 self.assertTrue(self.save_script_rc.called)
189 mock_filter_packages.assert_called_with([])
190 self.assertTrue(mock_update_nova_consoleauth_cfg.called)
191 self.assertTrue(mock_update_aws_compat_services.called)
192 self.service_pause.assert_called_with('neutron-server')
193
194 @patch.object(hooks, 'update_aws_compat_services')
195 @patch.object(hooks, 'update_nova_consoleauth_config')
196 @patch.object(hooks, 'is_db_initialised')
197 @patch.object(hooks, 'determine_packages')
198 @patch.object(utils, 'service_resume')
199 @patch.object(utils, 'config')
200 @patch.object(hooks, 'filter_installed_packages')
201 @patch.object(hooks, 'configure_https')
202 def test_config_changed_no_upgrade_juno_no_neutron_server(
203 self, conf_https, mock_filter_packages,
204 utils_config, mock_service_resume,
205 mock_determine_packages,
206 mock_is_db_initialised,
207 mock_update_nova_consoleauth_cfg,
208 mock_update_aws_compat_services):
209 mock_determine_packages.return_value = []
210 utils_config.side_effect = self.test_config.get
211 self.test_config.set('console-access-protocol', 'dummy')
212 self.openstack_upgrade_available.return_value = False
213 mock_is_db_initialised.return_value = False
214 self.os_release.return_value = 'juno'
215 self.service_pause.side_effect = ValueError
216 hooks.config_changed()
217 self.assertTrue(self.save_script_rc.called)
218 mock_filter_packages.assert_called_with([])
219 self.assertTrue(mock_update_nova_consoleauth_cfg.called)
220 self.assertTrue(mock_update_aws_compat_services.called)
221 self.service_pause.assert_called_with('neutron-server')
222
223 @patch.object(hooks, 'update_aws_compat_services')
224 @patch.object(hooks, 'update_nova_consoleauth_config')
225 @patch.object(hooks, 'is_db_initialised')
168 @patch.object(hooks, 'quantum_joined') 226 @patch.object(hooks, 'quantum_joined')
169 @patch.object(hooks, 'determine_packages') 227 @patch.object(hooks, 'determine_packages')
170 @patch.object(utils, 'service_resume') 228 @patch.object(utils, 'service_resume')
diff --git a/unit_tests/test_nova_cc_utils.py b/unit_tests/test_nova_cc_utils.py
index a8e7c28..e5dbe50 100644
--- a/unit_tests/test_nova_cc_utils.py
+++ b/unit_tests/test_nova_cc_utils.py
@@ -34,14 +34,13 @@ TO_PATCH = [
34 'apt_update', 34 'apt_update',
35 'apt_upgrade', 35 'apt_upgrade',
36 'apt_install', 36 'apt_install',
37 'cmd_all_services',
38 'config', 37 'config',
39 'configure_installation_source', 38 'configure_installation_source',
40 'disable_policy_rcd', 39 'disable_policy_rcd',
41 'is_leader', 40 'is_leader',
41 'is_unit_paused_set',
42 'lsb_release', 42 'lsb_release',
43 'enable_policy_rcd', 43 'enable_policy_rcd',
44 'enable_services',
45 'get_os_codename_install_source', 44 'get_os_codename_install_source',
46 'log', 45 'log',
47 'os_release', 46 'os_release',
@@ -50,6 +49,8 @@ TO_PATCH = [
50 'relation_ids', 49 'relation_ids',
51 'remote_unit', 50 'remote_unit',
52 '_save_script_rc', 51 '_save_script_rc',
52 'service_pause',
53 'service_resume',
53 'service_start', 54 'service_start',
54 'services', 55 'services',
55 'service_running', 56 'service_running',
@@ -666,29 +667,33 @@ class NovaCCUtilsTests(CharmTestCase):
666 "Migrate database with nova-manage" 667 "Migrate database with nova-manage"
667 self.relation_ids.return_value = [] 668 self.relation_ids.return_value = []
668 self.os_release.return_value = 'diablo' 669 self.os_release.return_value = 'diablo'
670 self.is_unit_paused_set.return_value = False
671 self.services.return_value = ['dummy-service']
669 utils.migrate_nova_databases() 672 utils.migrate_nova_databases()
670 check_output.assert_called_with(['nova-manage', 'db', 'sync']) 673 check_output.assert_called_with(['nova-manage', 'db', 'sync'])
671 self.assertTrue(self.enable_services.called) 674 self.assertTrue(self.service_resume.called)
672 self.cmd_all_services.assert_called_with('start')
673 675
674 @patch('subprocess.check_output') 676 @patch('subprocess.check_output')
675 def test_migrate_nova_databases_cluster(self, check_output): 677 def test_migrate_nova_databases_cluster(self, check_output):
676 "Migrate database with nova-manage in a clustered env" 678 "Migrate database with nova-manage in a clustered env"
677 self.relation_ids.return_value = ['cluster:1'] 679 self.relation_ids.return_value = ['cluster:1']
678 self.os_release.return_value = 'diablo' 680 self.os_release.return_value = 'diablo'
681 self.is_unit_paused_set.return_value = False
682 self.services.return_value = ['dummy-service']
679 utils.migrate_nova_databases() 683 utils.migrate_nova_databases()
680 check_output.assert_called_with(['nova-manage', 'db', 'sync']) 684 check_output.assert_called_with(['nova-manage', 'db', 'sync'])
681 self.assertNotIn(call(['nova-manage', 'db', 'online_data_migrations']), 685 self.assertNotIn(call(['nova-manage', 'db', 'online_data_migrations']),
682 check_output.mock_calls) 686 check_output.mock_calls)
683 self.peer_store.assert_called_with('dbsync_state', 'complete') 687 self.peer_store.assert_called_with('dbsync_state', 'complete')
684 self.assertTrue(self.enable_services.called) 688 self.assertTrue(self.service_resume.called)
685 self.cmd_all_services.assert_called_with('start')
686 689
687 @patch('subprocess.check_output') 690 @patch('subprocess.check_output')
688 def test_migrate_nova_databases_mitaka(self, check_output): 691 def test_migrate_nova_databases_mitaka(self, check_output):
689 "Migrate database with nova-manage in a clustered env" 692 "Migrate database with nova-manage in a clustered env"
690 self.relation_ids.return_value = ['cluster:1'] 693 self.relation_ids.return_value = ['cluster:1']
691 self.os_release.return_value = 'mitaka' 694 self.os_release.return_value = 'mitaka'
695 self.is_unit_paused_set.return_value = False
696 self.services.return_value = ['dummy-service']
692 utils.migrate_nova_databases() 697 utils.migrate_nova_databases()
693 check_output.assert_has_calls([ 698 check_output.assert_has_calls([
694 call(['nova-manage', 'api_db', 'sync']), 699 call(['nova-manage', 'api_db', 'sync']),
@@ -696,8 +701,7 @@ class NovaCCUtilsTests(CharmTestCase):
696 call(['nova-manage', 'db', 'online_data_migrations']), 701 call(['nova-manage', 'db', 'online_data_migrations']),
697 ]) 702 ])
698 self.peer_store.assert_called_with('dbsync_state', 'complete') 703 self.peer_store.assert_called_with('dbsync_state', 'complete')
699 self.assertTrue(self.enable_services.called) 704 self.assertTrue(self.service_resume.called)
700 self.cmd_all_services.assert_called_with('start')
701 705
702 @patch('subprocess.Popen') 706 @patch('subprocess.Popen')
703 @patch('subprocess.check_output') 707 @patch('subprocess.check_output')
@@ -709,6 +713,8 @@ class NovaCCUtilsTests(CharmTestCase):
709 get_cell_uuid.return_value = 'c83121db-f1c7-464a-b657-38c28fac84c6' 713 get_cell_uuid.return_value = 'c83121db-f1c7-464a-b657-38c28fac84c6'
710 self.relation_ids.return_value = ['cluster:1'] 714 self.relation_ids.return_value = ['cluster:1']
711 self.os_release.return_value = 'ocata' 715 self.os_release.return_value = 'ocata'
716 self.is_unit_paused_set.return_value = False
717 self.services.return_value = ['dummy-service']
712 process_mock = MagicMock() 718 process_mock = MagicMock()
713 attrs = { 719 attrs = {
714 'communicate.return_value': ('output', 'error'), 720 'communicate.return_value': ('output', 'error'),
@@ -733,8 +739,7 @@ class NovaCCUtilsTests(CharmTestCase):
733 '--max-count', '50000'], stdout=-1) 739 '--max-count', '50000'], stdout=-1)
734 Popen.assert_has_calls([map_call]) 740 Popen.assert_has_calls([map_call])
735 self.peer_store.assert_called_with('dbsync_state', 'complete') 741 self.peer_store.assert_called_with('dbsync_state', 'complete')
736 self.assertTrue(self.enable_services.called) 742 self.assertTrue(self.service_resume.called)
737 self.cmd_all_services.assert_called_with('start')
738 743
739 @patch('subprocess.Popen') 744 @patch('subprocess.Popen')
740 @patch('subprocess.check_output') 745 @patch('subprocess.check_output')
@@ -746,6 +751,8 @@ class NovaCCUtilsTests(CharmTestCase):
746 get_cell_uuid.return_value = 'c83121db-f1c7-464a-b657-38c28fac84c6' 751 get_cell_uuid.return_value = 'c83121db-f1c7-464a-b657-38c28fac84c6'
747 self.relation_ids.return_value = ['cluster:1'] 752 self.relation_ids.return_value = ['cluster:1']
748 self.os_release.return_value = 'pike' 753 self.os_release.return_value = 'pike'
754 self.is_unit_paused_set.return_value = False
755 self.services.return_value = ['dummy-service']
749 utils.migrate_nova_databases() 756 utils.migrate_nova_databases()
750 check_output.assert_has_calls([ 757 check_output.assert_has_calls([
751 call(['nova-manage', 'api_db', 'sync']), 758 call(['nova-manage', 'api_db', 'sync']),
@@ -762,8 +769,7 @@ class NovaCCUtilsTests(CharmTestCase):
762 'c83121db-f1c7-464a-b657-38c28fac84c6']) 769 'c83121db-f1c7-464a-b657-38c28fac84c6'])
763 self.assertFalse(map_call in Popen.call_args_list) 770 self.assertFalse(map_call in Popen.call_args_list)
764 self.peer_store.assert_called_with('dbsync_state', 'complete') 771 self.peer_store.assert_called_with('dbsync_state', 'complete')
765 self.assertTrue(self.enable_services.called) 772 self.assertTrue(self.service_resume.called)
766 self.cmd_all_services.assert_called_with('start')
767 773
768 @patch('subprocess.check_output') 774 @patch('subprocess.check_output')
769 def test_migrate_nova_flavors(self, check_output): 775 def test_migrate_nova_flavors(self, check_output):