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

Proposed by Cory Johns
Status: Merged
Merged at revision: 99
Proposed branch: lp:~bigdata-dev/charms/trusty/apache-hadoop-client/status-removed
Merge into: lp:~bigdata-dev/charms/trusty/apache-hadoop-client/trunk
Diff against target: 22 lines (+9/-1)
2 files modified
hooks/hadoop-plugin-relation-changed (+7/-1)
hooks/hadoop-plugin-relation-departed (+2/-0)
To merge this branch: bzr merge lp:~bigdata-dev/charms/trusty/apache-hadoop-client/status-removed
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+267593@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, your bash is marvelous.

review: Approve
99. By Cory Johns

Added support for HDFS-only deployment

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

New drop to support hdfs-only status LGTM as well. Nice job, but next time, don't make me review twice :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hadoop-plugin-relation-changed'
2--- hooks/hadoop-plugin-relation-changed 2015-05-11 22:25:12 +0000
3+++ hooks/hadoop-plugin-relation-changed 2015-08-13 21:21:13 +0000
4@@ -1,4 +1,10 @@
5 #!/bin/bash
6-if [[ "$(relation-get hdfs-ready)" == "True" ]]; then
7+hdfs_ready="$(relation-get hdfs-ready)"
8+yarn_ready="$(relation-get yarn-ready)"
9+if [[ "$hdfs_ready" == "true" && "$yarn_ready" == "true" ]]; then
10 hooks/status-set active "Ready to run mapreduce jobs"
11+elif [[ "$hdfs_ready" == "true" ]]; then
12+ hooks/status-set active "Ready (HDFS only)"
13+else
14+ hooks/status-set waiting "Waiting for Hadoop to be ready"
15 fi
16
17=== added file 'hooks/hadoop-plugin-relation-departed'
18--- hooks/hadoop-plugin-relation-departed 1970-01-01 00:00:00 +0000
19+++ hooks/hadoop-plugin-relation-departed 2015-08-13 21:21:13 +0000
20@@ -0,0 +1,2 @@
21+#!/bin/bash
22+hooks/status-set blocked "Please add relation to apache-hadoop-plugin"

Subscribers

People subscribed via source and target branches

to all changes: