Bläddra i källkod

update cdplib

tsteuer 5 år sedan
förälder
incheckning
b2a5819d6c
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6 5
      cdplib/db_handlers/MongodbHandler.py
  2. 0 1
      cdplib/db_migration/ParseJsonSchema.py

+ 6 - 5
cdplib/db_handlers/MongodbHandler.py

@@ -9,20 +9,19 @@ Created on Mon Sep 16 13:27:44 2019
 """
 """
 
 
 
 
-import json
+
 import simplejson
 import simplejson
 import sys
 import sys
 import os
 import os
-import jsonref
 
 
-from copy import deepcopy
+
 from pymongo import MongoClient
 from pymongo import MongoClient
 import pandas as pd
 import pandas as pd
 import numpy as np
 import numpy as np
 
 
 sys.path.append(os.getcwd())
 sys.path.append(os.getcwd())
 from cdplib.log import Log
 from cdplib.log import Log
-from cdplib.Singleton_Threadsafe import SingletonThreadsafe
+from cdplib.db_migration.ParseJsonSchema import ParseJsonSchema
 
 
 
 
 #class MongodbHandlerPool(metaclass=SingletonThreadsafe):
 #class MongodbHandlerPool(metaclass=SingletonThreadsafe):
@@ -115,8 +114,10 @@ class MongodbHandler:
             "Parameter 'validation_lever' must be a string type"
             "Parameter 'validation_lever' must be a string type"
         assert(isinstance(validation_action, str)),\
         assert(isinstance(validation_action, str)),\
             "Parameter 'validation_action' must be a string type"
             "Parameter 'validation_action' must be a string type"
+            
+        parse_obj = ParseJsonSchema()
 
 
-        schema = self._read_schema(schema_path)
+        schema = parse_obj.read_schema_and_parse_for_mongodb(schema_path)
 
 
         command = {
         command = {
                     'collMod': collection_name,
                     'collMod': collection_name,

+ 0 - 1
cdplib/db_migration/ParseJsonSchema.py

@@ -14,7 +14,6 @@ import json
 
 
 import jsonref
 import jsonref
 from pathlib import Path
 from pathlib import Path
-from urllib.parse import urljoin
 
 
 sys.path.append(os.getcwd())
 sys.path.append(os.getcwd())