2 # Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
19 """The SdnConnectorOdlOf connector is responsible for creating services using pro active operflow rules.
23 from osm_ro_plugin
.openflow_conn
import SdnConnectorOpenFlow
24 from .odl_of
import OfConnOdl
27 class SdnConnectorOdlOf(SdnConnectorOpenFlow
):
28 def __init__(self
, wim
, wim_account
, config
=None, logger
=None):
29 """Creates a connectivity based on pro-active openflow rules"""
30 self
.logger
= logging
.getLogger("ro.sdn.odlof")
31 super().__init
__(wim
, wim_account
, config
, logger
)
33 "of_url": wim
["wim_url"],
34 "of_dpid": config
.get("dpid") or config
.get("switch_id"),
35 "of_user": wim_account
["user"],
36 "of_password": wim_account
["password"],
38 self
.openflow_conn
= OfConnOdl(of_params
)
39 super().__init
__(wim
, wim_account
, config
, logger
, self
.openflow_conn
)