From 343c5302195c00582620270f47179ee91408bb1c Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
Date: Mon, 27 Feb 2017 13:39:46 +0000
Subject: [PATCH] content_archive_add: Use the right 'missing' status

Related: T494
---
 swh/archiver/db.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/swh/archiver/db.py b/swh/archiver/db.py
index 30b4e3f..2b34829 100644
--- a/swh/archiver/db.py
+++ b/swh/archiver/db.py
@@ -244,6 +244,12 @@ class ArchiverDb(BaseDb):
 
     def content_archive_add(
             self, content_id, sources_present, sources_missing, cur=None):
+        """Add content archive entry for the content content_id.
+        The status is:
+        - present for all sources in sources_present.
+        - missing for all sources in sources_missing.
+
+        """
 
         if isinstance(content_id, bytes):
             content_id = '\\x%s' % hashutil.hash_to_hex(content_id)
@@ -259,7 +265,7 @@ class ArchiverDb(BaseDb):
 
         for source in sources_missing:
             copies[source] = {
-                "status": "absent",
+                "status": "missing",
             }
 
         query = """INSERT INTO content_archive(content_id, copies, num_present)
-- 
GitLab