Merge lp:~seyeongkim/charms/trusty/cinder/lp1383801 into lp:~openstack-charmers-archive/charms/trusty/cinder/next

Proposed by Seyeong Kim
Status: Superseded
Proposed branch: lp:~seyeongkim/charms/trusty/cinder/lp1383801
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder/next
Diff against target: 12 lines (+3/-0)
1 file modified
hooks/cinder_hooks.py (+3/-0)
To merge this branch: bzr merge lp:~seyeongkim/charms/trusty/cinder/lp1383801
Reviewer Review Type Date Requested Status
Billy Olsen Needs Fixing
OpenStack Charmers Pending
Review via email: mp+266176@code.launchpad.net

This proposal has been superseded by a proposal from 2015-07-30.

Description of the change

add restarting cinder-volume service on config-changed hook

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #7127 cinder-next for xtrusia mp266176
    LINT OK: passed

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

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

charm_unit_test #6622 cinder-next for xtrusia mp266176
    UNIT OK: passed

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

Revision history for this message
Billy Olsen (billy-olsen) wrote :

Adding a service_restart will guarantee that the service gets restarted whenever juju feels the urge to run the config_changed hook, which at the minimum per documentation (https://jujucharms.com/docs/devel/authors-charm-hooks#config-changed) includes:

- after install
- after upgrade charm
- after an agent is restarted
- whenever a configuration value is changed

And not in the documentation but also:
- whenever an agent loses connection with the state server(s)
- whenever a juju backup is created
- whenever else juju feels like it should

The config-changed hook should be expected to be invoked frequently. As such, restarting the cinder service every time will be disruptive.

We may need to see if we can further isolate this scenario a bit -or- use the underlying framework to detect if the value has changed (there is _some_ support in charmhelpers code, but I've little and less experience using it - see charmhelpers/core/unitdata.py iirc).

review: Needs Fixing
111. By Seyeong Kim

add condition for avoiding multiple restart

112. By Seyeong Kim

add unit test

113. By Seyeong Kim

fix lint error

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/cinder_hooks.py'
2--- hooks/cinder_hooks.py 2015-07-21 19:28:23 +0000
3+++ hooks/cinder_hooks.py 2015-07-30 03:03:36 +0000
4@@ -144,6 +144,9 @@
5 upgrade_nonce=uuid.uuid4())
6
7 CONFIGS.write_all()
8+ # overwrite config is not in conf file. so We can't use restart_on_change
9+ if config_value_changed('overwrite'):
10+ service_restart('cinder-volume')
11 configure_https()
12 update_nrpe_config()
13

Subscribers

People subscribed via source and target branches