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

Proposed by Cory Johns
Status: Merged
Merged at revision: 96
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-master/status-removed
Merge into: lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-master/trunk
Diff against target: 119 lines (+84/-0)
5 files modified
hooks/callbacks.py (+4/-0)
hooks/common.py (+2/-0)
hooks/datanode-relation-departed (+26/-0)
hooks/namenode-relation-departed (+26/-0)
hooks/secondary-relation-departed (+26/-0)
To merge this branch: bzr merge lp:~bigdata-dev/charms/trusty/apache-hadoop-hdfs-master/status-removed
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+267595@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-25 15:38:21 +0000
3+++ hooks/callbacks.py 2015-08-10 23:06:14 +0000
4@@ -37,3 +37,7 @@
5 hookenv.status_set('waiting', 'Waiting for compute slaves to provide DataNodes')
6 else:
7 hookenv.status_set('blocked', 'Waiting for relation to compute slaves')
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-25 15:39:10 +0000
15+++ hooks/common.py 2015-08-10 23:06:14 +0000
16@@ -100,8 +100,10 @@
17 callbacks.update_active_status,
18 ],
19 'cleanup': [
20+ callbacks.clear_active_flag,
21 charmframework.helpers.close_ports(dist_config.exposed_ports('hdfs-master')),
22 hdfs.stop_namenode,
23+ callbacks.update_active_status,
24 ],
25 },
26 ])
27
28=== added file 'hooks/datanode-relation-departed'
29--- hooks/datanode-relation-departed 1970-01-01 00:00:00 +0000
30+++ hooks/datanode-relation-departed 2015-08-10 23:06:14 +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()
58
59=== added file 'hooks/namenode-relation-departed'
60--- hooks/namenode-relation-departed 1970-01-01 00:00:00 +0000
61+++ hooks/namenode-relation-departed 2015-08-10 23:06:14 +0000
62@@ -0,0 +1,26 @@
63+#!/usr/bin/env python
64+# Licensed under the Apache License, Version 2.0 (the "License");
65+# you may not use this file except in compliance with the License.
66+# You may obtain a copy of the License at
67+#
68+# http://www.apache.org/licenses/LICENSE-2.0
69+#
70+# Unless required by applicable law or agreed to in writing, software
71+# distributed under the License is distributed on an "AS IS" BASIS,
72+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73+# See the License for the specific language governing permissions and
74+# limitations under the License.
75+
76+"""
77+All hooks in this charm are managed by the Charm Framework.
78+The framework helps manage dependencies and preconditions to ensure that
79+steps are only executed when they can be successful. As such, no additional
80+code should be added to this hook; instead, please integrate new functionality
81+into the 'callbacks' list in hooks/common.py. New callbacks can be placed
82+in hooks/callbacks.py, if necessary.
83+
84+See http://big-data-charm-helpers.readthedocs.org/en/latest/examples/framework.html
85+for more information.
86+"""
87+import common
88+common.manage()
89
90=== added file 'hooks/secondary-relation-departed'
91--- hooks/secondary-relation-departed 1970-01-01 00:00:00 +0000
92+++ hooks/secondary-relation-departed 2015-08-10 23:06:14 +0000
93@@ -0,0 +1,26 @@
94+#!/usr/bin/env python
95+# Licensed under the Apache License, Version 2.0 (the "License");
96+# you may not use this file except in compliance with the License.
97+# You may obtain a copy of the License at
98+#
99+# http://www.apache.org/licenses/LICENSE-2.0
100+#
101+# Unless required by applicable law or agreed to in writing, software
102+# distributed under the License is distributed on an "AS IS" BASIS,
103+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104+# See the License for the specific language governing permissions and
105+# limitations under the License.
106+
107+"""
108+All hooks in this charm are managed by the Charm Framework.
109+The framework helps manage dependencies and preconditions to ensure that
110+steps are only executed when they can be successful. As such, no additional
111+code should be added to this hook; instead, please integrate new functionality
112+into the 'callbacks' list in hooks/common.py. New callbacks can be placed
113+in hooks/callbacks.py, if necessary.
114+
115+See http://big-data-charm-helpers.readthedocs.org/en/latest/examples/framework.html
116+for more information.
117+"""
118+import common
119+common.manage()

Subscribers

People subscribed via source and target branches

to all changes: