From: Pedro Escaleira Date: Tue, 28 Mar 2023 17:44:11 +0000 (+0100) Subject: Bug 2230 fixed: added verification for when there are no WIM accounts X-Git-Tag: release-v14.0-start~18 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F13105%2F2;p=osm%2FLCM.git Bug 2230 fixed: added verification for when there are no WIM accounts Change-Id: Ib12c9ea9262b8aa46d12f3f760e952ce4df8c056 Signed-off-by: Pedro Escaleira --- diff --git a/osm_lcm/data_utils/wim.py b/osm_lcm/data_utils/wim.py index c8ce0bf..ce2c26c 100644 --- a/osm_lcm/data_utils/wim.py +++ b/osm_lcm/data_utils/wim.py @@ -80,6 +80,11 @@ def select_feasible_wim_account(db_nsr, db_vnfrs, target_vld, vld_params, logger candidate_wims = get_candidate_wims(vims_to_connect) logger.info("Candidate WIMs: {:s}".format(str(candidate_wims))) + # check if there are no WIM candidates + if len(candidate_wims) == 0: + logger.info("No WIM accounts found") + return None, None + # check if a desired wim_account_id is specified in vld_params wim_account_id = vld_params.get("wimAccountId") if wim_account_id: