aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-06-12 17:22:32 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-06-12 17:22:32 +0800
commit16c204935312ebde607ac8b69c1c3a8510ddcdcd (patch)
tree9ca816589bdea177fd4a31c068264a1858b08e10
parent98302b6aeb36cbb6d07bbe805f52edbce9ecb30e (diff)
delete invalid judge
Delete invalid judge of pnfd_id. Issue-ID: VFC-1416 Change-Id: I80051eee2eb689f5947b53dcce076852eb6fe408 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
-rw-r--r--catalog/packages/biz/pnf_descriptor.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/catalog/packages/biz/pnf_descriptor.py b/catalog/packages/biz/pnf_descriptor.py
index e2a027b9..1a11fe08 100644
--- a/catalog/packages/biz/pnf_descriptor.py
+++ b/catalog/packages/biz/pnf_descriptor.py
@@ -169,11 +169,10 @@ class PnfDescriptor(object):
if pnfdVersion == "":
pnfdName = pnfd["metadata"].get("name", "")
- if pnfd_id:
- other_pnf = PnfPackageModel.objects.filter(pnfdId=pnfd_id)
- if other_pnf and other_pnf[0].pnfPackageId != pnfd_info_id:
- logger.info('PNFD(%s) already exists.' % pnfd_id)
- raise CatalogException("PNFD(%s) already exists." % pnfd_id)
+ other_pnf = PnfPackageModel.objects.filter(pnfdId=pnfd_id)
+ if other_pnf and other_pnf[0].pnfPackageId != pnfd_info_id:
+ logger.info('PNFD(%s) already exists.' % pnfd_id)
+ raise CatalogException("PNFD(%s) already exists." % pnfd_id)
pnf_pkgs.update(
pnfdId=pnfd_id,