Fix cinder mode backup fail into an infinite loop
When use cinder mode to backup cinder volume which is bigger than 1G in devstack environment, it will fail into an infinite loop. It is because the max_file_size in swift.conf is set to 1G by default. This will cause creating image error, and then cause freezer-agent failure. This patch will catch the exceptions and fix the issue. Change-Id: Icee5656a3f187b128313a98918b9c6c9612f66c9 Closes-Bug: #1703373
This commit is contained in:
parent
f8060ae001
commit
bbe6c15924
|
@ -288,9 +288,15 @@ class OSClientManager(object):
|
|||
LOG.info("Image status: " + image.status)
|
||||
image = self.get_glance().images.get(image.id)
|
||||
if image.status in ("killed", "deleted"):
|
||||
raise Exception("Image have killed state")
|
||||
raise RuntimeError("Image in killed or deleted state")
|
||||
except RuntimeError:
|
||||
if image.status == 'killed':
|
||||
LOG.info("Delete image in killed state " + image_id)
|
||||
self.get_glance().images.delete(image_id)
|
||||
raise
|
||||
except Exception as e:
|
||||
if image.status in ("killed", "deleted"):
|
||||
if hasattr(e, 'code') and e.code == 404:
|
||||
LOG.warning('Image is not found ' + image_id)
|
||||
raise
|
||||
LOG.exception(e)
|
||||
LOG.warning("Exception getting image status")
|
||||
|
|
Loading…
Reference in New Issue