From 61a5f4729a2b180f21f490db5d24d8d36acd9605 Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
Date: Thu, 22 Sep 2016 12:31:46 +0200
Subject: [PATCH] Refactor: Align source/destination configuration property
 names

---
 swh/archiver/director.py | 6 +++---
 swh/archiver/worker.py   | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/swh/archiver/director.py b/swh/archiver/director.py
index 24d4128..b6dfebe 100644
--- a/swh/archiver/director.py
+++ b/swh/archiver/director.py
@@ -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
diff --git a/swh/archiver/worker.py b/swh/archiver/worker.py
index c797de5..f7f8938 100644
--- a/swh/archiver/worker.py
+++ b/swh/archiver/worker.py
@@ -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
 
-- 
GitLab