From e2158b7ef4c307ff5be7bd2ef0ca3044f37759d4 Mon Sep 17 00:00:00 2001 From: "ting.wang" Date: Sat, 20 Feb 2016 14:28:08 +0800 Subject: Clean redundant argument to dict.get `dict.get()` returns `None` by default, if a key wasn't found. Removing `None` as second argument to avoid redundancy. Change-Id: Ia82f7469cd019509bbeccbfe54b15eeedc7bb6ea --- openstackclient/common/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openstackclient/common/exceptions.py') diff --git a/openstackclient/common/exceptions.py b/openstackclient/common/exceptions.py index ab043db0..8ec49931 100644 --- a/openstackclient/common/exceptions.py +++ b/openstackclient/common/exceptions.py @@ -122,8 +122,8 @@ def from_response(response, body): if body: if hasattr(body, 'keys'): error = body[body.keys()[0]] - message = error.get('message', None) - details = error.get('details', None) + message = error.get('message') + details = error.get('details') else: # If we didn't get back a properly formed error message we # probably couldn't communicate with Keystone at all. -- cgit v1.2.1