From: Wilson Liu Date: Wed, 24 Feb 2016 07:48:56 +0000 (+0800) Subject: Huawei: Log the IP when login fails X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=415f136dc50504e3a8e5158e996df1e07f633309;p=openstack-build%2Fcinder-build.git Huawei: Log the IP when login fails 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 --- diff --git a/cinder/volume/drivers/huawei/rest_client.py b/cinder/volume/drivers/huawei/rest_client.py index 7ff674952..fae0a6a42 100644 --- a/cinder/volume/drivers/huawei/rest_client.py +++ b/cinder/volume/drivers/huawei/rest_client.py @@ -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})