]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Huawei: Log the IP when login fails
authorWilson Liu <liuxinguo@huawei.com>
Wed, 24 Feb 2016 07:48:56 +0000 (15:48 +0800)
committerWilson Liu <liuxinguo@huawei.com>
Wed, 24 Feb 2016 08:37:56 +0000 (16:37 +0800)
Now we support configuring multi-ips,
if one ip login fails, we will try to
connect to other ips. The problem is,
if one ip login fails, the log message
did not tell users which ip fails.

Closes-Bug: #1549157
Change-Id: I4aa933c37b1fe20438c330fd86b2a67524834e8d

cinder/volume/drivers/huawei/rest_client.py

index 7ff67495202245e3782e523b285aac1393320b6c..fae0a6a42c22e865f1b192a792bdcf8a25adb972 100644 (file)
@@ -112,7 +112,9 @@ class RestClient(object):
                                   calltimeout=constants.LOGIN_SOCKET_TIMEOUT)
 
             if (result['error']['code'] != 0) or ("data" not in result):
-                LOG.error(_LE("Login error, reason is: %s."), result)
+                LOG.error(_LE("Login error. URL: %(url)s\n"
+                              "Reason: %(reason)s."),
+                          {"url": item_url, "reason": result})
                 continue
 
             LOG.debug('Login success: %(url)s', {'url': item_url})