From 16c204935312ebde607ac8b69c1c3a8510ddcdcd Mon Sep 17 00:00:00 2001 From: hewei-cmss Date: Wed, 12 Jun 2019 17:22:32 +0800 Subject: delete invalid judge Delete invalid judge of pnfd_id. Issue-ID: VFC-1416 Change-Id: I80051eee2eb689f5947b53dcce076852eb6fe408 Signed-off-by: hewei-cmss --- catalog/packages/biz/pnf_descriptor.py | 9 ++++----- 1 file 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, -- cgit 1.2.3-korg