X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=openflow;h=cac14de6cd53f3fc973e60807fc21d697828eee2;hb=9cead2a0262deabadc900d580ef312fbc468efc0;hp=4df9338cbf8c7124161d9ddc213bb0818f2c3fac;hpb=6c6006528a473fff882151806251aa36c5fbf5b8;p=osm%2Fopenvim.git diff --git a/openflow b/openflow index 4df9338..cac14de 100755 --- a/openflow +++ b/openflow @@ -3,7 +3,7 @@ # 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. # @@ -40,8 +40,8 @@ import imp 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): @@ -279,7 +279,7 @@ if __name__=="__main__": 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) @@ -375,10 +375,10 @@ if __name__=="__main__": 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))