koalalorenzo/python-digitalocean — pull request #12 by sztanko (2013-10-01 16:47:35+00:00)
Title: Message source in case of non OK status

Current codes tries to throw a message with data['message'] in case if status is not "OK"
However the latest digitalocean API has "error_message" instead of "message":
{
status: "ERROR",
error_message: "The image you specified is not available in the selected region, you can make it globally available by initiating an image region transfer from the images tab."
}

Added code to check both "message" and "error_message". If none exists (which should not happen), it gives back the content of "status".