def __init__(self, host='127.0.0.1', port=27017, database='vasp', user=None, password=None, collection='tasks', aliases_config=None, default_properties=None):
    if has_mongo():
        try:
            QueryEngine.__init__(self, host=host, port=port, database=database, user=user, password=password, collection=collection, aliases_config=aliases_config, default_properties=default_properties)
            _log.warning('Connected to real MongoDB at {}:{}'.format(host, port))
            return
        except:
            _log.debug('Connection to real MongoDB at {}:{} failed. This is normal; using mock.'.format(host, port))
    self.connection = MongoClient(host, port)
    self.db = self.connection[database]
    (self._user, self._password) = (user, password)
    self.host = host
    self.port = port
    self.database_name = database
    self.collection_name = collection
    self.set_aliases_and_defaults(aliases_config=aliases_config, default_properties=default_properties)
def __init__(self, host='127.0.0.1', port=27017, database='vasp', user=None, password=None, collection='tasks', aliases_config=None, default_properties=None):
    if has_mongo():
        try:
            QueryEngine.__init__(self, host=host, port=port, database=database, user=user, password=password, collection=collection, aliases_config=aliases_config, default_properties=default_properties)
            _log.warning('Connected to real MongoDB at {}:{}'.format(host, port))
            return
        except:
            _log.debug('Connection to real MongoDB at {}:{} failed. This is normal; using mock.'.format(host, port))
    self.connection = MongoClient(host, port)
    self.db = self.connection[database]
    (self._user, self._password) = (user, password)
    self.host = host
    self.port = port
    self.database_name = database
    self.collection_name = collection
    self.set_aliases_and_defaults(aliases_config=aliases_config, default_properties=default_properties)