From 415f136dc50504e3a8e5158e996df1e07f633309 Mon Sep 17 00:00:00 2001 From: Wilson Liu Date: Wed, 24 Feb 2016 15:48:56 +0800 Subject: [PATCH] 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 --- cinder/volume/drivers/huawei/rest_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}) -- 2.45.2