Bug fixed Arista SDN plugin
[osm/RO.git] / RO-SDN-floodlight_openflow / osm_rosdn_floodlightof / sdnconn_floodlightof.py
1 ##
2 # Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U.
3 # All Rights Reserved.
4 #
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
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
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
14 # implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 ##
19 """The SdnConnectorFloodLightOf connector is responsible for creating services using pro active operflow rules.
20 """
21
22 import logging
23 from osm_ro.wim.openflow_conn import SdnConnectorOpenFlow
24 from .floodlight_of import OfConnFloodLight
25
26
27 class SdnConnectorFloodLightOf(SdnConnectorOpenFlow):
28
29 def __init__(self, wim, wim_account, config=None, logger=None):
30 """Creates a connectivity based on pro-active openflow rules
31 """
32 self.logger = logging.getLogger('openmano.sdnconn.floodlightof')
33 super().__init__(wim, wim_account, config, logger)
34 of_params = {
35 "of_url": wim["wim_url"],
36 "of_dpid": config.get("dpid"),
37 "of_user": wim_account["user"],
38 "of_password": wim_account["password"],
39 }
40 self.openflow_conn = OfConnFloodLight(of_params)
41 super().__init__(wim, wim_account, config, logger, self.openflow_conn)