Merge ~cjwatson/layer-coordinator:config-flags into layer-coordinator:master

Proposed by Colin Watson
Status: Needs review
Proposed branch: ~cjwatson/layer-coordinator:config-flags
Merge into: layer-coordinator:master
Diff against target: 132 lines (+40/-24)
4 files modified
hooks/coordinator-relation-changed (+10/-6)
hooks/coordinator-relation-departed (+10/-6)
hooks/leader-elected (+10/-6)
hooks/leader-settings-changed (+10/-6)
Reviewer Review Type Date Requested Status
Stuart Bishop Pending
Review via email: mp+441314@code.launchpad.net

Commit message

Update hooks to handle setting config flags

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/hooks/coordinator-relation-changed b/hooks/coordinator-relation-changed
index fe39f65..9858c6b 100755
--- a/hooks/coordinator-relation-changed
+++ b/hooks/coordinator-relation-changed
@@ -1,18 +1,22 @@
1#!/usr/bin/env python31#!/usr/bin/env python3
22
3# Load modules from $CHARM_DIR/lib3# Load modules from $JUJU_CHARM_DIR/lib
4import sys4import sys
5sys.path.append('lib')5sys.path.append('lib')
66
7from charms.layer.basic import bootstrap_charm_deps7from charms.layer import basic # noqa
8bootstrap_charm_deps()8basic.bootstrap_charm_deps()
9
10from charmhelpers.core import hookenv # noqa
11hookenv.atstart(basic.init_config_states)
12hookenv.atexit(basic.clear_config_states)
913
1014
11# This will load and run the appropriate @hook and other decorated15# This will load and run the appropriate @hook and other decorated
12# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,16# handlers from $JUJU_CHARM_DIR/reactive, $JUJU_CHARM_DIR/hooks/reactive,
13# and $CHARM_DIR/hooks/relations.17# and $JUJU_CHARM_DIR/hooks/relations.
14#18#
15# See https://jujucharms.com/docs/stable/authors-charm-building19# See https://jujucharms.com/docs/stable/authors-charm-building
16# for more information on this pattern.20# for more information on this pattern.
17from charms.reactive import main21from charms.reactive import main # noqa
18main()22main()
diff --git a/hooks/coordinator-relation-departed b/hooks/coordinator-relation-departed
index fe39f65..9858c6b 100755
--- a/hooks/coordinator-relation-departed
+++ b/hooks/coordinator-relation-departed
@@ -1,18 +1,22 @@
1#!/usr/bin/env python31#!/usr/bin/env python3
22
3# Load modules from $CHARM_DIR/lib3# Load modules from $JUJU_CHARM_DIR/lib
4import sys4import sys
5sys.path.append('lib')5sys.path.append('lib')
66
7from charms.layer.basic import bootstrap_charm_deps7from charms.layer import basic # noqa
8bootstrap_charm_deps()8basic.bootstrap_charm_deps()
9
10from charmhelpers.core import hookenv # noqa
11hookenv.atstart(basic.init_config_states)
12hookenv.atexit(basic.clear_config_states)
913
1014
11# This will load and run the appropriate @hook and other decorated15# This will load and run the appropriate @hook and other decorated
12# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,16# handlers from $JUJU_CHARM_DIR/reactive, $JUJU_CHARM_DIR/hooks/reactive,
13# and $CHARM_DIR/hooks/relations.17# and $JUJU_CHARM_DIR/hooks/relations.
14#18#
15# See https://jujucharms.com/docs/stable/authors-charm-building19# See https://jujucharms.com/docs/stable/authors-charm-building
16# for more information on this pattern.20# for more information on this pattern.
17from charms.reactive import main21from charms.reactive import main # noqa
18main()22main()
diff --git a/hooks/leader-elected b/hooks/leader-elected
index fe39f65..9858c6b 100755
--- a/hooks/leader-elected
+++ b/hooks/leader-elected
@@ -1,18 +1,22 @@
1#!/usr/bin/env python31#!/usr/bin/env python3
22
3# Load modules from $CHARM_DIR/lib3# Load modules from $JUJU_CHARM_DIR/lib
4import sys4import sys
5sys.path.append('lib')5sys.path.append('lib')
66
7from charms.layer.basic import bootstrap_charm_deps7from charms.layer import basic # noqa
8bootstrap_charm_deps()8basic.bootstrap_charm_deps()
9
10from charmhelpers.core import hookenv # noqa
11hookenv.atstart(basic.init_config_states)
12hookenv.atexit(basic.clear_config_states)
913
1014
11# This will load and run the appropriate @hook and other decorated15# This will load and run the appropriate @hook and other decorated
12# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,16# handlers from $JUJU_CHARM_DIR/reactive, $JUJU_CHARM_DIR/hooks/reactive,
13# and $CHARM_DIR/hooks/relations.17# and $JUJU_CHARM_DIR/hooks/relations.
14#18#
15# See https://jujucharms.com/docs/stable/authors-charm-building19# See https://jujucharms.com/docs/stable/authors-charm-building
16# for more information on this pattern.20# for more information on this pattern.
17from charms.reactive import main21from charms.reactive import main # noqa
18main()22main()
diff --git a/hooks/leader-settings-changed b/hooks/leader-settings-changed
index fe39f65..9858c6b 100755
--- a/hooks/leader-settings-changed
+++ b/hooks/leader-settings-changed
@@ -1,18 +1,22 @@
1#!/usr/bin/env python31#!/usr/bin/env python3
22
3# Load modules from $CHARM_DIR/lib3# Load modules from $JUJU_CHARM_DIR/lib
4import sys4import sys
5sys.path.append('lib')5sys.path.append('lib')
66
7from charms.layer.basic import bootstrap_charm_deps7from charms.layer import basic # noqa
8bootstrap_charm_deps()8basic.bootstrap_charm_deps()
9
10from charmhelpers.core import hookenv # noqa
11hookenv.atstart(basic.init_config_states)
12hookenv.atexit(basic.clear_config_states)
913
1014
11# This will load and run the appropriate @hook and other decorated15# This will load and run the appropriate @hook and other decorated
12# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,16# handlers from $JUJU_CHARM_DIR/reactive, $JUJU_CHARM_DIR/hooks/reactive,
13# and $CHARM_DIR/hooks/relations.17# and $JUJU_CHARM_DIR/hooks/relations.
14#18#
15# See https://jujucharms.com/docs/stable/authors-charm-building19# See https://jujucharms.com/docs/stable/authors-charm-building
16# for more information on this pattern.20# for more information on this pattern.
17from charms.reactive import main21from charms.reactive import main # noqa
18main()22main()

Subscribers

People subscribed via source and target branches

to all changes: