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

Subscribers

People subscribed via source and target branches

to all changes: