Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cli create git fail #3267

Merged
merged 8 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 6 additions & 4 deletions utils/cli/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ def tasks_create(self, name, labels, overlap, segment_size, bug, resource_type,
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']}.")

Expand Down