Fix TypeError when doing glance retry

'controller' arg is removed in the first retry loop,
just kick it out of loop.

Change-Id: Id592107e383d7cde3e376309c8d5b351fc60d7be
Closes-Bug: #1871744
This commit is contained in:
yenai 2020-04-09 10:28:03 +08:00
parent edd5bcace2
commit 2e46e7ddb9
1 changed files with 2 additions and 2 deletions

View File

@ -216,6 +216,7 @@ class GlanceClientWrapper(object):
glanceclient.exc.InvalidEndpoint,
glanceclient.exc.CommunicationError)
num_attempts = 1 + CONF.glance_num_retries
glance_controller = kwargs.pop('controller', 'images')
store_id = kwargs.pop('store_id', None)
base_image_ref = kwargs.pop('base_image_ref', None)
@ -230,8 +231,7 @@ class GlanceClientWrapper(object):
client.http_client.additional_headers = headers
try:
controller = getattr(client,
kwargs.pop('controller', 'images'))
controller = getattr(client, glance_controller)
return getattr(controller, method)(*args, **kwargs)
except retry_excs as e:
netloc = self.netloc