summaryrefslogtreecommitdiffstats
path: root/cvp/opnfv_testapi/db/api.py
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-07-05 22:37:35 -0400
committerGeorg Kunz <georg.kunz@ericsson.com>2018-07-25 09:17:09 +0000
commit58b91dd3baaaf72ab65062a4804403cd4a5935b2 (patch)
tree801b1f39b3bee25ecbaae387339955d55651e98b /cvp/opnfv_testapi/db/api.py
parent947f1bf0147c40971fdae36feecd477ab3caf3b8 (diff)
Move OVP web portal code to a separate repo
The new repo for web portal is https://gerrit.opnfv.org/gerrit/dovetail-webportal JIRA: DOVETAIL-671 Change-Id: Iac085abc3d175b9a091d70d0448af56c7a6845e9 Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'cvp/opnfv_testapi/db/api.py')
-rw-r--r--cvp/opnfv_testapi/db/api.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/cvp/opnfv_testapi/db/api.py b/cvp/opnfv_testapi/db/api.py
deleted file mode 100644
index c057480d..00000000
--- a/cvp/opnfv_testapi/db/api.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import motor
-
-from opnfv_testapi.common.config import CONF
-
-DB = motor.MotorClient(CONF.mongo_url)[CONF.mongo_dbname]
-
-
-def db_update(collection, query, update_req):
- return _eval_db(collection, 'update', query, update_req, check_keys=False)
-
-
-def db_delete(collection, query):
- return _eval_db(collection, 'remove', query)
-
-
-def db_aggregate(collection, pipelines):
- return _eval_db(collection, 'aggregate', pipelines, allowDiskUse=True)
-
-
-def db_list(collection, query):
- return _eval_db(collection, 'find', query)
-
-
-def db_save(collection, data):
- return _eval_db(collection, 'insert', data, check_keys=False)
-
-
-def db_find_one(collection, query):
- return _eval_db(collection, 'find_one', query)
-
-
-def _eval_db(collection, method, *args, **kwargs):
- exec_collection = DB.__getattr__(collection)
- return exec_collection.__getattribute__(method)(*args, **kwargs)
-
-
-def _eval_db_find_one(query, table=None):
- return _eval_db(table, 'find_one', query)