未验证 提交 140489dc 编写于 作者: A André Aquilina 提交者: GitHub

Fix cli create git fail (#3267)

* Fix issue of infinite loop due to incorrect status comparison.

* Update CHANGELOG.md

* Fix PEP8.

* Update failure case to break from infinite loop.

* Update utils/cli/core/core.py
Co-authored-by: NBoris Sekachev <boris.sekachev@intel.com>

* Add check for unknown failure.

* Fix logging in failure case.

* Update CHANGELOG.md
Co-authored-by: NBoris Sekachev <boris.sekachev@intel.com>
Co-authored-by: NAndré Aquilina <andre.aquilina@dysismedical.com>
上级 5168ca67
......@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Project page requests took a long time and did many DB queries (<https://github.com/openvinotoolkit/cvat/pull/3223>)
- Fixed Python 3.6 support (<https://github.com/openvinotoolkit/cvat/pull/3258>)
- Incorrect attribute import in tracks (<https://github.com/openvinotoolkit/cvat/pull/3229>)
- Fix CLI create an infinite loop if git repository responds with failure (<https://github.com/openvinotoolkit/cvat/pull/3267>)
### Security
......
......@@ -124,14 +124,16 @@ class CLI():
check_url = self.api.git_check(rq_id)
response = self.session.get(check_url)
response_json = response.json()
log.info('''Awaiting dataset repository for task. Status: {}'''.format(
response_json['status']))
while response_json['status'] != 'finished':
log.info('''Awaiting a dataset repository to be created for the task. Response status: {}'''.format(
response_json['status']))
sleep(git_completion_verification_period)
response = self.session.get(check_url)
response_json = response.json()
if response_json['status'] == 'Failed':
log.error(f'Dataset repository creation request for task {task_id} failed.')
if response_json['status'] == 'failed' or response_json['status'] == 'unknown':
log.error(f'Dataset repository creation request for task {task_id} failed'
f'with status {response_json["status"]}.')
break
log.info(f"Dataset repository creation completed with status: {response_json['status']}.")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册