Merge lp://staging/~gnuoy/charms/trusty/nova-cloud-controller/disable-services-until-db-ready into lp://staging/~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liam Young
Status: Merged
Merged at revision: 100
Proposed branch: lp://staging/~gnuoy/charms/trusty/nova-cloud-controller/disable-services-until-db-ready
Merge into: lp://staging/~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 337 lines (+175/-7)
6 files modified
charm-helpers-hooks.yaml (+1/-0)
hooks/charmhelpers/contrib/peerstorage/__init__.py (+83/-0)
hooks/nova_cc_hooks.py (+34/-3)
hooks/nova_cc_utils.py (+34/-2)
unit_tests/test_nova_cc_hooks.py (+5/-0)
unit_tests/test_nova_cc_utils.py (+18/-2)
To merge this branch: bzr merge lp://staging/~gnuoy/charms/trusty/nova-cloud-controller/disable-services-until-db-ready
Reviewer Review Type Date Requested Status
Liam Young (community) Needs Resubmitting
James Page Needs Fixing
Review via email: mp+230495@code.staging.launchpad.net

Description of the change

This mp shuts down and disables all related services until the db sync script has run. If the unit is not the leader it receives notification that the sync is complete via the peer relation.

There is also a small fix to the vip_group logic which was causing grp_nova_vips to not be set if only one vip is specified.

To post a comment you must log in.
97. By Liam Young

Lint fixes

Revision history for this message
James Page (james-page) wrote :

Hi Liam

This looks like a good start, but I don't think your proposed changes play well with the restart_on_change decorator; if the configuration files change during hook execution, restart_on_change will restart all services post any stop/disablement that you have done in the hook.

The disable/stop needs to run after restart on change - maybe the service_guard decorator is a good place todo this?

review: Needs Fixing
98. By Liam Young

Having 'manual' in the upstart override file stops the service being started on reboot but not if a service restart is issued. So, updated override file to set the upstart exec command to be 'true' instead to knobble the service

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

I did look at putting the logic into service_guard but it would mean that the service could be brought up by the main function or restart_on_change and then shutdown again by service_guard which still leaves scope for data to be inserted during the migration. Also it didn't feel like it logically sat in service guard which is why I abandoned that approach and went for upstart service disabling. I like this approach because the services are shutdown straight after install and remain down until the db init has been done which makes sense to me.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches