delete invalid judge 37/89737/1
authorhewei-cmss <hewei@cmss.chinamobile.com>
Wed, 12 Jun 2019 09:22:32 +0000 (17:22 +0800)
committerhewei-cmss <hewei@cmss.chinamobile.com>
Wed, 12 Jun 2019 09:22:32 +0000 (17:22 +0800)
Delete invalid judge of pnfd_id.

Issue-ID: VFC-1416

Change-Id: I80051eee2eb689f5947b53dcce076852eb6fe408
Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
catalog/packages/biz/pnf_descriptor.py

index e2a027b..1a11fe0 100644 (file)
@@ -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,