From 55f706e8b13d8ab8e7c2111de414ead56db0abdd Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 11 Mar 2026 09:12:00 +0100 Subject: [PATCH] VMstore: Fix pylint failure We have in the CI: cinder/volume/drivers/vmstore/api.py:122:44: E0601: Using variable 'response' before assignment (used-before-assignment). Let's fix this. Signed-off-by: Thomas Goirand Change-Id: Ie06ea7bc89ef5b8fafa8308b624437652ab428c8 --- cinder/volume/drivers/vmstore/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cinder/volume/drivers/vmstore/api.py b/cinder/volume/drivers/vmstore/api.py index 28c6c465e21..0790ed4fbc8 100644 --- a/cinder/volume/drivers/vmstore/api.py +++ b/cinder/volume/drivers/vmstore/api.py @@ -119,7 +119,12 @@ class VmstoreRequest(object): code = 'RESOURCE_NOT_FOUND' message = str(error) self.error = VmstoreException(message, code=code) - if 'cinder/host/refresh' in response.request.url: + + url = None + if hasattr(error, "response") and error.response is not None: + url = getattr(error.response.request, "url", None) + + if url and 'cinder/host/refresh' in url: raise self.error else: LOG.error('Failed request %(info)s: %(error)s',