未验证 提交 4928447e 编写于 作者: C chunfu wen 提交者: GitHub

Merge pull request #2676 from xiaodwan/v2v_improve_exception_report

Improve error report when exception happens before Target initialization
......@@ -1221,13 +1221,14 @@ def v2v_cmd(params, auto_clean=True, cmd_only=False):
cmd_result = process.run(cmd, timeout=v2v_cmd_timeout,
verbose=True, ignore_status=True)
finally:
if auto_clean:
target_obj.cleanup()
else:
# Save it into global params and release it by users
v2v_dirty_resources = global_params.get('v2v_dirty_resources', [])
v2v_dirty_resources.append(target_obj)
global_params.update({'v2v_dirty_resources': v2v_dirty_resources})
# Save it into global params and release it by users
v2v_dirty_resources = global_params.get('v2v_dirty_resources', [])
global_params.update({'v2v_dirty_resources': v2v_dirty_resources})
if 'target_obj' in locals():
if auto_clean:
target_obj.cleanup()
else:
v2v_dirty_resources.append(target_obj)
# Post-process for v2v
_v2v_post_cmd()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册