コード例 #1
0
 def reset_db(cls, force=False):
     """ clean the database """
     if os.getenv("APPR_DB_ALLOW_RESET", "false") == "true" or force:
         try:
             etcd_client.delete(appr.models.kv.APPR_KV_PREFIX, recursive=True)
         except etcd.EtcdKeyNotFound:
             pass
     else:
         raise Forbidden("Reset DB is deactivated")
コード例 #2
0
 def reset_db(cls, force=False):
     """ clean the database """
     if os.getenv("APPR_DB_ALLOW_RESET", "false") == "true" or force:
         redis_client.flushall()
     else:
         raise Forbidden("Reset DB is deactivated")
コード例 #3
0
ファイル: db.py プロジェクト: steved/appr
 def reset_db(cls, force=False):
     """ clean the database """
     if os.getenv("APPR_DB_ALLOW_RESET", "false") == "true" or force:
         filesystem_client.flushall(appr.models.kv.APPR_KV_PREFIX)
     else:
         raise Forbidden("Reset DB is deactivated")
コード例 #4
0
ファイル: db_base.py プロジェクト: joejulian/appr
 def reset_db(cls, force=False):
     """ clean the database """
     if os.getenv("APPR_DB_ALLOW_RESET", "false") == "true" or force:
         raise NotImplementedError
     else:
         raise Forbidden("Reset DB is deactivated")