Merge lp://qastaging/~danilo/charms/trusty/glance-simplestreams-sync/leader-only into lp://qastaging/~landscape/charms/trusty/glance-simplestreams-sync/landscape

Proposed by Данило Шеган
Status: Rejected
Rejected by: Данило Шеган
Proposed branch: lp://qastaging/~danilo/charms/trusty/glance-simplestreams-sync/leader-only
Merge into: lp://qastaging/~landscape/charms/trusty/glance-simplestreams-sync/landscape
Diff against target: 107 lines (+40/-7)
2 files modified
hooks/hooks.py (+12/-0)
scripts/glance-simplestreams-sync.py (+28/-7)
To merge this branch: bzr merge lp://qastaging/~danilo/charms/trusty/glance-simplestreams-sync/leader-only
Reviewer Review Type Date Requested Status
Bogdana Vereha (community) Approve
Chris Glass (community) Approve
Review via email: mp+293753@code.qastaging.launchpad.net

Description of the change

Make glance-simplestreams-sync.py script no-op when not run on the leader unit

To avoid changing the structure too much, we do not set-up and destroy cronjobs in leader-change hooks, but instead simply make the cronjob script no-op when not run on the leader unit. Cronjob setup is a bit intricate and involved (there's a per-minute cronjob set initially, along with the cronjob depending on the frequency configured for the service).

Testing instructions:

This charm has been published at cs:~danilo/trusty/glance-simplestreams-sync-21

See Landscape branch that integrates this charm https://code.launchpad.net/~danilo/landscape/ha-image-refresh/+merge/293751

To post a comment you must log in.
70. By Данило Шеган

Strip the returned value from is-leader.

Revision history for this message
Chris Glass (tribaal) wrote :

Looks good, one nitpick inline.

review: Approve
71. By Данило Шеган

Return explicit False (instead of implicit None) in is_leader() on exception.

Revision history for this message
Данило Шеган (danilo) :
Revision history for this message
Bogdana Vereha (bogdana) wrote :

+1

review: Approve
72. By Данило Шеган

Add leader hooks.

73. By Данило Шеган

Merge landscape charm tip.

74. By Данило Шеган

Do not drop the glance-simplestreams-sync per-minute cronjob when not leader inside the script, but manage that from leader-related hooks.

Revision history for this message
Данило Шеган (danilo) wrote :

As discussed with David, we'll be shelving this work for now, waiting for glance-simplestreams-sync stuff to be integrated into glance itself, when we'll get HA as well.

Unmerged revisions

74. By Данило Шеган

Do not drop the glance-simplestreams-sync per-minute cronjob when not leader inside the script, but manage that from leader-related hooks.

73. By Данило Шеган

Merge landscape charm tip.

72. By Данило Шеган

Add leader hooks.

71. By Данило Шеган

Return explicit False (instead of implicit None) in is_leader() on exception.

70. By Данило Шеган

Strip the returned value from is-leader.

69. By Данило Шеган

Merge lint fixes from trunk.

68. By Данило Шеган

Lint fix.

67. By Данило Шеган

Revert accidental change.

66. By Данило Шеган

Use a better check for is-leader.

65. By Данило Шеган

Do not validate full configuration when getting unit_name for juju_run_cmd().

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