+ if net_type in ("data", "ptp"):
+ provider_physical_network = None
+ if provider_network_profile and provider_network_profile.get("physical-network"):
+ provider_physical_network = provider_network_profile.get("physical-network")
+ # provider-network must be one of the dataplane_physcial_netowrk if this is a list. If it is string
+ # or not declared, just ignore the checking
+ if isinstance(self.config.get('dataplane_physical_net'), (tuple, list)) and \
+ provider_physical_network not in self.config['dataplane_physical_net']:
+ raise vimconn.VimConnConflictException(
+ "Invalid parameter 'provider-network:physical-network' for network creation. '{}' is not "
+ "one of the declared list at VIM_config:dataplane_physical_net".format(
+ provider_physical_network))
+ if not provider_physical_network: # use the default dataplane_physical_net
+ provider_physical_network = self.config.get('dataplane_physical_net')
+ # if it is non empty list, use the first value. If it is a string use the value directly
+ if isinstance(provider_physical_network, (tuple, list)) and provider_physical_network:
+ provider_physical_network = provider_physical_network[0]
+
+ if not provider_physical_network:
+ raise vimconn.VimConnConflictException(
+ "missing information needed for underlay networks. Provide 'dataplane_physical_net' "
+ "configuration at VIM or use the NS instantiation parameter 'provider-network.physical-network'"
+ " for the VLD")
+