From: Anirudh Gupta Date: Tue, 13 May 2025 05:53:38 +0000 (+0000) Subject: Removal of F824 (unnecessary use of nonlocal keyword) flake8 error and Revert Pin... X-Git-Tag: v18.0.0~17 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F15198%2F1;p=osm%2FLCM.git Removal of F824 (unnecessary use of nonlocal keyword) flake8 error and Revert Pin flake8 version while flake issues are being fixed (8a995a253c3ab1b31b8274794f832845d16bfb7e) Change-Id: Ide548d6c6408863c09f31ea3a4e086f7305983bc Signed-off-by: Anirudh Gupta --- diff --git a/osm_lcm/netslice.py b/osm_lcm/netslice.py index 8fe291b5..b5e66426 100644 --- a/osm_lcm/netslice.py +++ b/osm_lcm/netslice.py @@ -137,7 +137,7 @@ class NetsliceLcm(LcmBase): :param vld_id The VLD id inside nsir to be created :param nsir_id The nsir id """ - nonlocal nsi_vld_instantiationi_params + # nonlocal nsi_vld_instantiationi_params ip_vld = None mgmt_network = False RO_vld_sites = [] @@ -297,8 +297,8 @@ class NetsliceLcm(LcmBase): db_nsir_update["_admin.deployed.RO"].append(db_nsir_update_RO) def overwrite_nsd_params(self, db_nsir, nslcmop): - nonlocal nsi_vld_instantiationi_params - nonlocal db_nsir_update + # nonlocal nsi_vld_instantiationi_params + # nonlocal db_nsir_update vld_op_list = [] vld = None nsr_id = nslcmop.get("nsInstanceId") diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 4ed36cf5..8906e2a8 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -690,7 +690,7 @@ class NsLcm(LcmBase): db_vims = {} def get_vim_account(vim_account_id): - nonlocal db_vims + # nonlocal db_vims if vim_account_id in db_vims: return db_vims[vim_account_id] db_vim = self.db.get_one("vim_accounts", {"_id": vim_account_id}) @@ -3778,7 +3778,7 @@ class NsLcm(LcmBase): } async def _get_cluster_id(cluster_id, cluster_type): - nonlocal k8scluster_id_2_uuic + # nonlocal k8scluster_id_2_uuic if cluster_id in k8scluster_id_2_uuic[cluster_type]: return k8scluster_id_2_uuic[cluster_type][cluster_id] @@ -8438,7 +8438,7 @@ class NsLcm(LcmBase): """ def get_vim_account(vim_account_id): - nonlocal db_vims + # nonlocal db_vims if vim_account_id in db_vims: return db_vims[vim_account_id] db_vim = self.db.get_one("vim_accounts", {"_id": vim_account_id}) diff --git a/tox.ini b/tox.ini index f106d067..268ae782 100644 --- a/tox.ini +++ b/tox.ini @@ -55,7 +55,7 @@ allowlist_externals = sh ####################################################################################### [testenv:flake8] -deps = flake8==7.1.2 +deps = flake8 commands = flake8 osm_lcm/ setup.py