aboutsummaryrefslogtreecommitdiffstats
path: root/python_moondb
diff options
context:
space:
mode:
authorRuan HE <ruan.he@orange.com>2018-01-03 13:57:31 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-03 13:57:31 +0000
commit681cfafb6a58757d2c56a135d909561d4a654a13 (patch)
tree286b5fd1ca31a5fb3c872015143c0ee74f0b9040 /python_moondb
parent6d73ea7305c469fc983f29d85743663877fe0882 (diff)
parentb01b0784b8f350f50bd7ed9ed4794483691e63b3 (diff)
Merge "Add update exception"
Diffstat (limited to 'python_moondb')
-rw-r--r--python_moondb/python_moondb/api/pdp.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python_moondb/python_moondb/api/pdp.py b/python_moondb/python_moondb/api/pdp.py
index d39418b8..7e852ca8 100644
--- a/python_moondb/python_moondb/api/pdp.py
+++ b/python_moondb/python_moondb/api/pdp.py
@@ -20,6 +20,8 @@ class PDPManager(Managers):
@enforce(("read", "write"), "pdp")
def update_pdp(self, user_id, pdp_id, value):
+ if pdp_id not in self.driver.get_pdp(pdp_id=pdp_id):
+ raise exceptions.PdpUnknown
return self.driver.update_pdp(pdp_id=pdp_id, value=value)
@enforce(("read", "write"), "pdp")