Add leader and status new hooks #122

Merged
merged 2 commits into from May 11, 2015
Jump to file or symbol
Failed to load files and symbols.
+21 −9
Split
View
@@ -11,15 +11,19 @@ const (
// None of these hooks are ever associated with a relation; each of them
// represents a change to the state of the unit as a whole. The values
// themselves are all valid hook names.
- Install Kind = "install"
- Start Kind = "start"
- ConfigChanged Kind = "config-changed"
- UpgradeCharm Kind = "upgrade-charm"
- Stop Kind = "stop"
- ActionRequested Kind = "action-requested" // TODO: remove in charm v5, DEPRECATED
- Action Kind = "action"
- CollectMetrics Kind = "collect-metrics"
- MeterStatusChanged Kind = "meter-status-changed"
+ Install Kind = "install"
+ Start Kind = "start"
+ ConfigChanged Kind = "config-changed"
+ UpgradeCharm Kind = "upgrade-charm"
+ Stop Kind = "stop"
+ ActionRequested Kind = "action-requested" // TODO: remove in charm v5, DEPRECATED
+ Action Kind = "action"
+ CollectMetrics Kind = "collect-metrics"
+ MeterStatusChanged Kind = "meter-status-changed"
+ LeaderElected Kind = "leader-elected"
+ LeaderDeposed Kind = "leader-deposed"
+ LeaderSettingsChanged Kind = "leader-settings-changed"
+ UpdateStatus Kind = "update-status"
// These hooks require an associated relation, and the name of the relation
// unit whose change triggered the hook. The hook file names that these
@@ -49,6 +53,10 @@ var unitHooks = []Kind{
Stop,
CollectMetrics,
MeterStatusChanged,
+ LeaderElected,
+ LeaderDeposed,
+ LeaderSettingsChanged,
+ UpdateStatus,
}
// UnitHooks returns all known unit hook kinds.
View
@@ -377,6 +377,10 @@ func (s *MetaSuite) TestMetaHooks(c *gc.C) {
"stop": true,
"collect-metrics": true,
"meter-status-changed": true,
+ "leader-elected": true,
+ "leader-deposed": true,
+ "leader-settings-changed": true,
+ "update-status": true,
"cache-relation-joined": true,
"cache-relation-changed": true,
"cache-relation-departed": true,