Merge "[Tempest] Handle errored shares correctly using recreation logic"
This commit is contained in:
commit
2c1cfc3a07
|
@ -454,18 +454,28 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
for d in data:
|
for d in data:
|
||||||
if d["available"]:
|
if d["available"]:
|
||||||
continue
|
continue
|
||||||
|
client = d["kwargs"]["client"]
|
||||||
|
share_id = d["share"]["id"]
|
||||||
try:
|
try:
|
||||||
d["kwargs"]["client"].wait_for_share_status(
|
client.wait_for_share_status(share_id, "available")
|
||||||
d["share"]["id"], "available")
|
|
||||||
d["available"] = True
|
d["available"] = True
|
||||||
except (share_exceptions.ShareBuildErrorException,
|
except (share_exceptions.ShareBuildErrorException,
|
||||||
exceptions.TimeoutException) as e:
|
exceptions.TimeoutException) as e:
|
||||||
if CONF.share.share_creation_retry_number > d["cnt"]:
|
if CONF.share.share_creation_retry_number > d["cnt"]:
|
||||||
d["cnt"] += 1
|
d["cnt"] += 1
|
||||||
msg = ("Share '%s' failed to be built. "
|
msg = ("Share '%s' failed to be built. "
|
||||||
"Trying create another." % d["share"]["id"])
|
"Trying create another." % share_id)
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
LOG.error(e)
|
LOG.error(e)
|
||||||
|
cg_id = d["kwargs"].get("consistency_group_id")
|
||||||
|
if cg_id:
|
||||||
|
# NOTE(vponomaryov): delete errored share
|
||||||
|
# immediately in case share is part of CG.
|
||||||
|
client.delete_share(
|
||||||
|
share_id,
|
||||||
|
params={"consistency_group_id": cg_id})
|
||||||
|
client.wait_for_resource_deletion(
|
||||||
|
share_id=share_id)
|
||||||
d["share"] = cls._create_share(
|
d["share"] = cls._create_share(
|
||||||
*d["args"], **d["kwargs"])
|
*d["args"], **d["kwargs"])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue