From 48a06d33b0a23cf9697f260476247821bf6816c6 Mon Sep 17 00:00:00 2001
From: ddamiron <ddamiron@sii.fr>
Date: Fri, 28 Jun 2019 15:35:11 +0200
Subject: [PATCH] hotfix  json.dump(log_message)

---
 main.py                       | 12 ++++++------
 workers/doc-enricher.py       |  4 ++--
 workers/doc-indexer.py        |  4 ++--
 workers/doc-processor.py      |  4 ++--
 workers/metadata-processor.py |  8 ++++----
 workers/reindexer.py          |  2 +-
 workers/sample-generator.py   |  4 ++--
 7 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/main.py b/main.py
index 03cad9c..0a1c5b9 100644
--- a/main.py
+++ b/main.py
@@ -233,12 +233,12 @@ def get_metadata_records_processor(the_rabbit,
 
         the_uuid = record['geonet:info']['uuid']
 
-        if is_locked(the_cfg['session']['working_directory'], the_uuid ):
-            logging.info("Dataset with uuid = %s is already being indexed: skipping." % the_uuid)
-            continue
-        else:
-            logging.info("Setting lock for dataset with uuid = %s" % the_uuid)
-            lock(the_cfg['session']['working_directory'], the_uuid)
+        # if is_locked(the_cfg['session']['working_directory'], the_uuid ):
+        #     logging.info("Dataset with uuid = %s is already being indexed: skipping." % the_uuid)
+        #     continue
+        # else:
+        #     logging.info("Setting lock for dataset with uuid = %s" % the_uuid)
+        #     lock(the_cfg['session']['working_directory'], the_uuid)
 
         # delete_dataset_from_indices(cfg, record['geonet:info']['uuid'])
         delete_dataset_from_dest_index(the_rabbit=the_rabbit,
diff --git a/workers/doc-enricher.py b/workers/doc-enricher.py
index 4dc10c2..9253394 100644
--- a/workers/doc-enricher.py
+++ b/workers/doc-enricher.py
@@ -253,7 +253,7 @@ def enrich_docs( channel, method, properties, body ):
                                      info='no info'
                                      )
 
-            json_body = json.dumps(log_message)
+            json_body = json.dumps(log_message.__dict__)
 
             print(" [x] json body : ", json_body)
 
@@ -290,7 +290,7 @@ def enrich_docs( channel, method, properties, body ):
                                  info='no info'
                                  )
 
-        json_body = json.dumps(log_message)
+        json_body = json.dumps(log_message.__dict__)
 
         print(" [x] json body : ", json_body)
 
diff --git a/workers/doc-indexer.py b/workers/doc-indexer.py
index 7eb62f7..74e4003 100644
--- a/workers/doc-indexer.py
+++ b/workers/doc-indexer.py
@@ -136,7 +136,7 @@ def index_docs(channel, method, properties, body):
                                  info='no info'
                                  )
 
-        json_body = json.dumps(log_message)
+        json_body = json.dumps(log_message.__dict__)
 
         print(" [x] json body : ", json_body)
 
@@ -208,7 +208,7 @@ def index_docs(channel, method, properties, body):
                              info='no info'
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
diff --git a/workers/doc-processor.py b/workers/doc-processor.py
index feabcc0..8089db0 100644
--- a/workers/doc-processor.py
+++ b/workers/doc-processor.py
@@ -125,7 +125,7 @@ def process_docs( channel, method, properties, body ):
                                  info='no info'
                                  )
 
-        json_body = json.dumps(log_message)
+        json_body = json.dumps(log_message.__dict__)
 
         print(" [x] json body : ", json_body)
 
@@ -166,7 +166,7 @@ def process_docs( channel, method, properties, body ):
                              info='no info'
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
diff --git a/workers/metadata-processor.py b/workers/metadata-processor.py
index c4c4fd0..e9c39fc 100644
--- a/workers/metadata-processor.py
+++ b/workers/metadata-processor.py
@@ -318,7 +318,7 @@ def callback( channel, method, properties, body ):
                              info='no info'
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
@@ -390,7 +390,7 @@ def callback( channel, method, properties, body ):
                                          info='no info'
                                          )
 
-                json_body = json.dumps(log_message)
+                json_body = json.dumps(log_message.__dict__)
 
                 print(" [x] json body : ", json_body)
 
@@ -438,7 +438,7 @@ def callback( channel, method, properties, body ):
                                  info='no info'
                                  )
 
-        json_body = json.dumps(log_message)
+        json_body = json.dumps(log_message.__dict__)
 
         print(" [x] json body : ", json_body)
 
@@ -459,7 +459,7 @@ def callback( channel, method, properties, body ):
                              info='no info'
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
diff --git a/workers/reindexer.py b/workers/reindexer.py
index 8537a24..e930efd 100644
--- a/workers/reindexer.py
+++ b/workers/reindexer.py
@@ -54,7 +54,7 @@ def create_sampling_task(cfg, channel, uuid):
                              info=uuid
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
diff --git a/workers/sample-generator.py b/workers/sample-generator.py
index aa90585..70d1c03 100644
--- a/workers/sample-generator.py
+++ b/workers/sample-generator.py
@@ -191,7 +191,7 @@ def callback(channel, method, properties, body):
                              info=uuid
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
@@ -241,7 +241,7 @@ def callback(channel, method, properties, body):
                              info=uuid
                              )
 
-    json_body = json.dumps(log_message)
+    json_body = json.dumps(log_message.__dict__)
 
     print(" [x] json body : ", json_body)
 
-- 
GitLab