Browse Source

Lgger enhancement on MH

Yann Weber 8 years ago
parent
commit
61b80b8262
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      plugins/mongodb_datasource/migration_handler.py

+ 6
- 1
plugins/mongodb_datasource/migration_handler.py View File

@@ -67,7 +67,6 @@ class MigrationHandler(object):
67 67
         for collection_name in [ object_collection_name(cls)
68 68
             for cls in emclass_list]:
69 69
             self._create_collection(collection_name)
70
-            logger.debug("Collection %s created" % collection_name)
71 70
 
72 71
     ## @brief Creates a collection in the database
73 72
     # @param collection_name str
@@ -77,9 +76,15 @@ class MigrationHandler(object):
77 76
         if collection_name in self.database.collection_names(include_system_collections=False):
78 77
             if if_exists == MigrationHandler.COMMANDS_IFEXISTS_DROP:
79 78
                 self._delete_collection(collection_name)
79
+                logger.debug("Collection %s deleted before creating \
80
+it again" % collection_name)
80 81
                 self.database.create_collection(name=collection_name)
82
+            else:
83
+                logger.info("Collection %s allready exists. \
84
+Doing nothing..." % collection_name)
81 85
         else:
82 86
             self.database.create_collection(name=collection_name)
87
+            logger.debug("Collection %s created" % collection_name)
83 88
 
84 89
     ## @brief Deletes a collection in the database
85 90
     # @param collection_name str

Loading…
Cancel
Save