# PYTHON_ARGCOMPLETE_OK
##
-# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
+# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U.
# This file is part of openmano
# All Rights Reserved.
#
import yaml
import requests
import logging
-import openflow_conn
-from openflow_thread import change_db2of, FlowBadFormat
+import osm_openvim.openflow_conn as openflow_conn
+from osm_openvim.openflow_thread import change_db2of, FlowBadFormat
def of_switches(args):
of_controller_password = os.getenv('OF_CONTROLLER_PASSWORD',None)
#of_controller_version = os.getenv('OF_CONTROLLER_VERSION',"0.90")
of_controller_ip = os.getenv('OF_CONTROLLER_IP',"localhost")
- of_controller_port = os.getenv('OF_CONTROLLER_PORT',"7070")
+ of_controller_port = os.getenv('OF_CONTROLLER_PORT',"8080")
of_controller_dpid = os.getenv('OF_CONTROLLER_DPID','00:01:02:03:e4:05:e6:07')
of_controller_module = os.getenv('OF_CONTROLLER_MODULE',None)
module = of_controller_module
else:
module = of_controller_type
- module_info = imp.find_module(module)
-
- of_conn = imp.load_module("of_conn", *module_info)
+
try:
+ pkg = __import__("osm_openvim." + module)
+ of_conn = getattr(pkg, module)
ofconnector = of_conn.OF_conn(params)
except Exception as e:
print "Cannot open the Openflow controller '%s': %s" % (type(e).__name__, str(e))