- # OBS: sce_net without uuid are used internally to VNFs
- # and the assumption is that VNFs will not be split among
- # different datacenters
- wim_account = wim_engine.find_suitable_wim_account(
- involved_datacenters, tenant_id)
- wim_account_id = wim_account['uuid']
- wim_account_name = wim_account['name']
- wim_usage[sce_net['uuid']] = wim_account_id
+ if target_wim_account is None or target_wim_account is True: # automatic selection of WIM
+ # OBS: sce_net without uuid are used internally to VNFs
+ # and the assumption is that VNFs will not be split among
+ # different datacenters
+ wim_account = wim_engine.find_suitable_wim_account(
+ involved_datacenters, tenant_id)
+ wim_account_id = wim_account['uuid']
+ wim_account_name = wim_account['name']
+ wim_usage[sce_net['uuid']] = wim_account_id
+ elif isinstance(target_wim_account, str): # manual selection of WIM
+ wim_account.persist.get_wim_account_by(target_wim_account, tenant_id)
+ wim_account_id = wim_account['uuid']
+ wim_account_name = wim_account['name']
+ wim_usage[sce_net['uuid']] = wim_account_id
+ else: # not WIM usage
+ wim_usage[sce_net['uuid']] = False