Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP4:Update
vorta.17716
fix-fromisoformat.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-fromisoformat.patch of Package vorta.17716
From: Antonio Larrosa <alarrosa@suse.com> Subject: Fix use of datetime.fromisoformat which is not available in python3.6 Index: vorta-0.8.3/src/vorta/borg/create.py =================================================================== --- vorta-0.8.3.orig/src/vorta/borg/create.py +++ vorta-0.8.3/src/vorta/borg/create.py @@ -12,11 +12,16 @@ from .borg_job import BorgJob class BorgCreateJob(BorgJob): def process_result(self, result): if result['returncode'] in [0, 1] and 'archive' in result['data']: + try: + result_time = dt.strptime(result['data']['archive']['start'], r"%Y-%m-%dT%H:%M:%S.%f") + except ValueError: + result_time = dt.strptime(result['data']['archive']['start'], r"%Y-%m-%dT%H:%M:%S") + new_archive, created = ArchiveModel.get_or_create( snapshot_id=result['data']['archive']['id'], defaults={ 'name': result['data']['archive']['name'], - 'time': dt.fromisoformat(result['data']['archive']['start']), + 'time': result_time, 'repo': result['params']['repo_id'], 'duration': result['data']['archive']['duration'], 'size': result['data']['archive']['stats']['deduplicated_size'] Index: vorta-0.8.3/src/vorta/borg/list_repo.py =================================================================== --- vorta-0.8.3.orig/src/vorta/borg/list_repo.py +++ vorta-0.8.3/src/vorta/borg/list_repo.py @@ -44,12 +44,17 @@ class BorgListRepoJob(BorgJob): # Add remote archives we don't have locally. for archive in result['data'].get('archives', []): + try: + archive_time = dt.strptime(archive['time'], r"%Y-%m-%dT%H:%M:%S.%f") + except ValueError: + archive_time = dt.strptime(archive['time'], r"%Y-%m-%dT%H:%M:%S") + new_archive, _ = ArchiveModel.get_or_create( snapshot_id=archive['id'], repo=repo.id, defaults={ 'name': archive['name'], - 'time': dt.fromisoformat(archive['time']) + 'time': archive_time } ) new_archive.save()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor