You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2019/04/26 23:41:49 UTC

[incubator-ponymail] branch master updated: copy-list.py --target does not work

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 46b80e8  copy-list.py --target does not work
46b80e8 is described below

commit 46b80e8c7bc4ed03c2d0774c4a0dcf44fcd3ef90
Author: Sebb <se...@apache.org>
AuthorDate: Sat Apr 27 00:41:35 2019 +0100

    copy-list.py --target does not work
    
    This fixes #491
---
 CHANGELOG.md       | 1 +
 tools/copy-list.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c196e0..44e4a81 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 - Bug: Errors with Elasticsearch 5.x in edit-lists.py (#489)
 - Bug: Errors with Elasticsearch 5.x in nullfav.py (#489)
 - Enh: Support scan/scroll for all current versions of ES (#489-contd)
+- Bug: copy-list.py --target does not work (#491)
 - Bug/Enh: setup.py tries to install Python modules (#465)
 
 ## Changes in 0.11:
diff --git a/tools/copy-list.py b/tools/copy-list.py
index ab7100e..bdd3405 100755
--- a/tools/copy-list.py
+++ b/tools/copy-list.py
@@ -124,6 +124,7 @@ while (scroll_size > 0):
     for hit in page['hits']['hits']:
         doc = hit['_id']
         body = es.get(doc_type = 'mbox', id = doc)
+        srcdoc = doc # save
         if targetLID != sourceLID:
             doc = hit['_id'].replace(sourceLID,targetLID)
             body['_source']['mid'] = doc
@@ -136,7 +137,7 @@ while (scroll_size > 0):
             '_id': doc,
             '_source': body['_source']
         })
-        source = es.get(doc_type = 'mbox_source', id = doc, ignore=404)
+        source = es.get(doc_type = 'mbox_source', id = srcdoc, ignore=404)
         if source['found']:
             js_arr.append({
                 '_op_type': 'index',