Merge lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-secondary/status-removed into lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-secondary/trunk

Proposed by Cory Johns
Status: Merged
Merged at revision: 75
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-secondary/status-removed
Merge into: lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-secondary/trunk
Diff against target: 57 lines (+32/-0)
3 files modified
hooks/callbacks.py (+4/-0)
hooks/common.py (+2/-0)
hooks/secondary-relation-departed (+26/-0)
To merge this branch: bzr merge lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-secondary/status-removed
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+267596@code.launchpad.net

Description of the change

Fixed status reporting not being accurate when relations were removed

To post a comment you must log in.
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/callbacks.py'
2--- hooks/callbacks.py 2015-06-24 22:13:14 +0000
3+++ hooks/callbacks.py 2015-08-10 23:06:30 +0000
4@@ -40,3 +40,7 @@
5 def update_active_status():
6 unitdata.kv().set('charm.active', True)
7 hookenv.status_set('active', 'Ready')
8+
9+
10+def clear_active_flag():
11+ unitdata.kv().set('charm.active', False)
12
13=== modified file 'hooks/common.py'
14--- hooks/common.py 2015-06-24 22:13:14 +0000
15+++ hooks/common.py 2015-08-10 23:06:30 +0000
16@@ -88,8 +88,10 @@
17 callbacks.update_active_status,
18 ],
19 'cleanup': [
20+ callbacks.clear_active_flag,
21 charmframework.helpers.close_ports(dist_config.exposed_ports('secondary-namenode')),
22 hdfs.stop_secondarynamenode,
23+ callbacks.update_blocked_status,
24 ],
25 },
26 ])
27
28=== added file 'hooks/secondary-relation-departed'
29--- hooks/secondary-relation-departed 1970-01-01 00:00:00 +0000
30+++ hooks/secondary-relation-departed 2015-08-10 23:06:30 +0000
31@@ -0,0 +1,26 @@
32+#!/usr/bin/env python
33+# Licensed under the Apache License, Version 2.0 (the "License");
34+# you may not use this file except in compliance with the License.
35+# You may obtain a copy of the License at
36+#
37+# http://www.apache.org/licenses/LICENSE-2.0
38+#
39+# Unless required by applicable law or agreed to in writing, software
40+# distributed under the License is distributed on an "AS IS" BASIS,
41+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42+# See the License for the specific language governing permissions and
43+# limitations under the License.
44+
45+"""
46+All hooks in this charm are managed by the Charm Framework.
47+The framework helps manage dependencies and preconditions to ensure that
48+steps are only executed when they can be successful. As such, no additional
49+code should be added to this hook; instead, please integrate new functionality
50+into the 'callbacks' list in hooks/common.py. New callbacks can be placed
51+in hooks/callbacks.py, if necessary.
52+
53+See http://big-data-charm-helpers.readthedocs.org/en/latest/examples/framework.html
54+for more information.
55+"""
56+import common
57+common.manage()

Subscribers

People subscribed via source and target branches

to all changes: