Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse ClusterStatus’es StateChangeReason. #2696

Merged
merged 1 commit into from Nov 26, 2014

Conversation

paxan
Copy link
Contributor

@paxan paxan commented Oct 20, 2014

I've ran into this issue when writing code to detect the EMR cluster's demise reason. Turns out Boto wasn't parsing it.

Here's the patch. And here it is in action:

>>> import boto, boto.emr
>>> emr = boto.emr.connect_to_region('us-east-1')
>>> cs=emr.list_clusters().clusters
>>> cs[0]
<boto.emr.emrobject.ClusterSummary object at 0x106829790>
>>> cs[0].status
<boto.emr.emrobject.ClusterStatus object at 0x106829710>
>>> cs[0].status.state
u'TERMINATED'
>>> cs[0].status.statechangereason
<boto.emr.emrobject.ClusterStateChangeReason object at 0x10688e490>
>>> cs[0].status.statechangereason.code
u'USER_REQUEST'
>>> cs[0].status.statechangereason.message
u'Terminated by user request'

@kyleknap
Copy link
Member

Thanks for the PR! Looks good. Merging.

kyleknap added a commit that referenced this pull request Nov 26, 2014
Parse ClusterStatus’s StateChangeReason.
@kyleknap kyleknap merged commit 48c5d17 into boto:develop Nov 26, 2014
@paxan paxan deleted the clusterstatus-statechangereason branch November 26, 2014 23:36
@paxan
Copy link
Contributor Author

paxan commented Nov 26, 2014

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants