diff --git a/arctic/arctic.py b/arctic/arctic.py index 65bf7176136f9..3661993ffa174 100644 --- a/arctic/arctic.py +++ b/arctic/arctic.py @@ -1,10 +1,10 @@ import logging import os +import re +import threading import pymongo from pymongo.errors import OperationFailure, AutoReconnect -import threading - from ._util import indent from .auth import authenticate, get_auth from .decorators import mongo_retry @@ -233,6 +233,8 @@ def delete_library(self, library): """ l = ArcticLibraryBinding(self, library) colname = l.get_top_level_collection().name + if not [c for c in l._db.collection_names(False) if re.match(r"^{}([\.].*)?$".format(colname), c)]: + logger.info('Nothing to delete. Arctic library %s does not exist.' % colname) logger.info('Dropping collection: %s' % colname) l._db.drop_collection(colname) for coll in l._db.collection_names():