add judge package state 93/97093/2
authorhewei-cmss <hewei@cmss.chinamobile.com>
Tue, 15 Oct 2019 05:51:55 +0000 (13:51 +0800)
committerhewei-cmss <hewei@cmss.chinamobile.com>
Tue, 15 Oct 2019 06:12:42 +0000 (14:12 +0800)
Issue-ID: VFC-1504

Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
Change-Id: Ibd892c036ea5a4c0a7ee7a9ee7449ccc18bffadc

catalog/packages/biz/ns_descriptor.py

index bb6da1e..18f6b88 100644 (file)
@@ -89,10 +89,10 @@ class NsDescriptor(object):
         if ns_pkgs[0].operationalState != PKG_STATUS.DISABLED:
             logger.error('NSD(%s) shall be DISABLED.' % nsd_info_id)
             raise CatalogException('NSD(%s) shall be DISABLED.' % nsd_info_id)
-        if ns_pkgs[0].usageState != PKG_STATUS.NOT_IN_USE:
+        '''
+        if ns_pkgs[0].usageState == PKG_STATUS.IN_USE:
             logger.error('NSD(%s) shall be NOT_IN_USE.' % nsd_info_id)
             raise CatalogException('NSD(%s) shall be NOT_IN_USE.' % nsd_info_id)
-        '''
         ns_pkgs.delete()
         ns_pkg_path = os.path.join(CATALOG_ROOT_PATH, nsd_info_id)
         fileutil.delete_dirs(ns_pkg_path)