X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO-SDN-dynpac%2Fosm_rosdn_dynpac%2Fwimconn_dynpac.py;h=a2bd8d7a55227a508145900ac646eb062feb0e6c;hb=321d2e95499981ca8aa4c02027c0359d61115ff2;hp=7a84f2226f15f7de72ecf5bfef0189f97625df5a;hpb=80135b928ab442c38898750b4751480205b4affc;p=osm%2FRO.git diff --git a/RO-SDN-dynpac/osm_rosdn_dynpac/wimconn_dynpac.py b/RO-SDN-dynpac/osm_rosdn_dynpac/wimconn_dynpac.py index 7a84f222..a2bd8d7a 100644 --- a/RO-SDN-dynpac/osm_rosdn_dynpac/wimconn_dynpac.py +++ b/RO-SDN-dynpac/osm_rosdn_dynpac/wimconn_dynpac.py @@ -21,12 +21,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import requests +from enum import Enum import json import logging -from enum import Enum from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError +import requests class SdnError(Enum): @@ -228,9 +228,11 @@ class DynpacConnector(SdnConnectorBase): for connection_point in connection_points: endpoint_id = connection_point.get(self.__SERVICE_ENDPOINT_PARAM) - port = filter( - lambda x: x.get(self.__WAN_SERVICE_ENDPOINT_PARAM) == endpoint_id, - port_mapping, + port = list( + filter( + lambda x: x.get(self.__WAN_SERVICE_ENDPOINT_PARAM) == endpoint_id, + port_mapping, + ) )[0] port_info = port.get(self.__WAN_MAPPING_INFO_PARAM) selected_ports.append(port_info)