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

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

Subscribers

People subscribed via source and target branches

to all changes: