Skip to content
Snippets Groups Projects
Commit 61a5f472 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Refactor: Align source/destination configuration property names

parent 6500024c
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,7 @@ class ArchiverStdinToBackendDirector(ArchiverDirectorBase):
"""
ADDITIONAL_CONFIG = {
'destination_host': ('str', 'azure'),
'destination': ('str', 'azure'),
'force_copy': ('bool', False),
}
......@@ -176,7 +176,7 @@ class ArchiverStdinToBackendDirector(ArchiverDirectorBase):
def __init__(self):
super().__init__()
self.destination_host = self.config['destination_host']
self.destination = self.config['destination']
self.force_copy = self.config['force_copy']
def get_contents_to_archive(self):
......@@ -202,7 +202,7 @@ class ArchiverStdinToBackendDirector(ArchiverDirectorBase):
content_ids = list(
self.archiver_storage.content_archive_get_missing(
content_ids=content_ids,
backend_name=self.destination_host))
backend_name=self.destination))
if not content_ids:
continue
......
......@@ -39,7 +39,7 @@ class BaseArchiveWorker(config.SWHConfig, metaclass=abc.ABCMeta):
"""
DEFAULT_CONFIG = {
'dbconn': ('str', 'dbname=softwareheritage-archiver-dev'),
'source': 'uffizi',
'source': ('str', 'uffizi'),
'storages': ('list[dict]',
[
{'host': 'uffizi',
......@@ -391,7 +391,7 @@ class ArchiverToBackendWorker(BaseArchiveWorker):
"""
super().__init__(batch)
self.destination_host = self.config['destination_host']
self.destination = self.config['destination']
def need_archival(self, content_data):
"""Indicate if the content needs to be archived.
......@@ -405,7 +405,7 @@ class ArchiverToBackendWorker(BaseArchiveWorker):
True if we need to archive, False otherwise
"""
if self.destination_host in content_data.get('missing', {}):
if self.destination in content_data.get('missing', {}):
return True
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment