From: tierno Date: Wed, 26 Apr 2017 13:09:48 +0000 (+0200) Subject: fix issues running from source X-Git-Tag: v2.0.1~23 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F00%2F1700%2F4;p=osm%2Fopenvim.git fix issues running from source Change-Id: I512eebfd0c1531d22073a2389073fb1bcf1d0961 Signed-off-by: tierno --- diff --git a/openvimd b/openvimd index 0578ba5..1b3c7db 100755 --- a/openvimd +++ b/openvimd @@ -22,14 +22,11 @@ # contact with: nfvlabs@tid.es ## -''' +""" This is the main program of openvim, it reads the configuration and launches the rest of threads: http clients, openflow controller and host controllers -''' - -__author__ = "Alfonso Tierno" -__date__ = "$10-jul-2014 12:07:15$" +""" import osm_openvim.httpserver as httpserver import osm_openvim.auxiliary_functions as af @@ -39,12 +36,15 @@ import time import yaml import os from jsonschema import validate as js_v, exceptions as js_e -from vim_schema import config_schema +from osm_openvim.vim_schema import config_schema import logging import logging.handlers as log_handlers import socket import osm_openvim.ovim as ovim +__author__ = "Alfonso Tierno" +__date__ = "$10-jul-2014 12:07:15$" + global config_dic global logger logger = logging.getLogger('vim') @@ -110,7 +110,7 @@ def load_configuration(configuration_file): def usage(): print "Usage: ", sys.argv[0], "[options]" print " -v|--version: prints current version" - print " -c|--config FILE: loads the configuration file (default: openvimd.cfg)" + print " -c|--config FILE: loads the configuration file (default: osm_openvim/openvimd.cfg)" print " -h|--help: shows this help" print " -p|--port PORT: changes port number and overrides the port number in the configuration file (default: 908)" print " -P|--adminport PORT: changes admin port number and overrides the port number in the configuration file (default: not listen)" @@ -130,7 +130,7 @@ if __name__=="__main__": ) log_format_simple = "%(asctime)s %(levelname)s %(name)s %(filename)s:%(lineno)s %(message)s" log_formatter_simple = logging.Formatter(log_format_simple, datefmt='%Y-%m-%dT%H:%M:%S') - logging.basicConfig(format=log_format_simple, level= logging.DEBUG) + logging.basicConfig(format=log_format_simple, level=logging.DEBUG) logger = logging.getLogger('openvim') logger.setLevel(logging.DEBUG) try: @@ -143,7 +143,7 @@ if __name__=="__main__": port=None port_admin = None - config_file = 'openvimd.cfg' + config_file = 'osm_openvim/openvimd.cfg' log_file = None db_name = None diff --git a/osm_openvim/openvimd.cfg b/osm_openvim/openvimd.cfg index 9641938..732512b 100644 --- a/osm_openvim/openvimd.cfg +++ b/osm_openvim/openvimd.cfg @@ -133,7 +133,7 @@ dhcp_server: #logging parameters # DEBUG, INFO, WARNING, ERROR, CRITICAL -log_level: ERROR +log_level: DEBUG log_level_db: DEBUG log_level_of: DEBUG diff --git a/osm_openvim/ovim.py b/osm_openvim/ovim.py index f253912..a0c380d 100755 --- a/osm_openvim/ovim.py +++ b/osm_openvim/ovim.py @@ -22,16 +22,10 @@ # contact with: nfvlabs@tid.es ## -''' +""" This is the thread for the http server North API. Two thread will be launched, with normal and administrative permissions. -''' - -__author__ = "Alfonso Tierno, Leonardo Mirabal" -__date__ = "$06-Feb-2017 12:07:15$" -__version__ = "0.5.10-r526" -version_date = "Apr 2017" -database_version = "0.17" #expected database schema version +""" import threading import vim_db @@ -45,6 +39,11 @@ import dhcp_thread as dt import openflow_thread as oft import openflow_conn +__author__ = "Alfonso Tierno, Leonardo Mirabal" +__date__ = "$06-Feb-2017 12:07:15$" +__version__ = "0.5.11-r527" +version_date = "Apr 2017" +database_version = "0.17" #expected database schema version HTTP_Bad_Request = 400 HTTP_Unauthorized = 401 diff --git a/scripts/service-openvim b/scripts/service-openvim index 7eefa8e..cde4d1a 100755 --- a/scripts/service-openvim +++ b/scripts/service-openvim @@ -104,7 +104,7 @@ do screen_name="${om_component}" [[ -n "$option_screen_name" ]] && screen_name=$option_screen_name [ "${om_component}" == "flow" ] && om_cmd="floodlight.jar" && om_name="floodlight" && om_dir=$FLOODLIGHT_PATH - [ "${om_component}" == "vim" ] && om_cmd="./openvimd.py" && om_name="openvim " && om_dir=${DIR_OM} + [ "${om_component}" == "vim" ] && om_cmd="./openvimd" && om_name="openvim " && om_dir=${DIR_OM} #obtain PID of program component_id=`find_process_id "${om_cmd}" $option_screen_name` processes=$(echo $component_id | wc -w)