def needs_to_auth(self, dbname):
        """
        Determines if the server needs to authenticate to the database.
        NOTE: we stopped depending on is_auth() since its only a configuration
        and may not be accurate
        """
        log_debug("Checking if server '%s' needs to auth on  db '%s'...." %
                  (self.id, dbname))
        try:
            client = self.get_mongo_client()
            db = client.get_database(dbname)
            db.collection_names()
            result = False
        except (__HOLE__,Exception), e:
            log_exception(e)
            result = "authorized" in str(e)

        log_debug("needs_to_auth check for server '%s'  on db '%s' : %s" %
                  (self.id, dbname, result))
        return result

    ###########################################################################
dataset/ETHPy150Open mongolab/mongoctl/mongoctl/objects/server.py/Server.needs_to_auth