fix issues running from source 00/1700/4
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 26 Apr 2017 13:09:48 +0000 (15:09 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 26 Apr 2017 14:45:21 +0000 (15:45 +0100)
Change-Id: I512eebfd0c1531d22073a2389073fb1bcf1d0961
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openvimd
osm_openvim/openvimd.cfg
osm_openvim/ovim.py
scripts/service-openvim

index 0578ba5..1b3c7db 100755 (executable)
--- a/openvimd
+++ b/openvimd
 # contact with: nfvlabs@tid.es
 ##
 
 # 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  
 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
 
 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
 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
 
 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')
 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"
 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)"
     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')
     )
     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:
     logger = logging.getLogger('openvim')
     logger.setLevel(logging.DEBUG)
     try:
@@ -143,7 +143,7 @@ if __name__=="__main__":
 
     port=None
     port_admin = None
 
     port=None
     port_admin = None
-    config_file = 'openvimd.cfg'
+    config_file = 'osm_openvim/openvimd.cfg'
     log_file = None
     db_name = None
 
     log_file = None
     db_name = None
 
index 9641938..732512b 100644 (file)
@@ -133,7 +133,7 @@ dhcp_server:
 
 
 #logging parameters       # DEBUG, INFO, WARNING, ERROR, CRITICAL
 
 
 #logging parameters       # DEBUG, INFO, WARNING, ERROR, CRITICAL
-log_level:       ERROR
+log_level:       DEBUG
 log_level_db:    DEBUG
 log_level_of:    DEBUG
 
 log_level_db:    DEBUG
 log_level_of:    DEBUG
 
index f253912..a0c380d 100755 (executable)
 # contact with: nfvlabs@tid.es
 ##
 
 # 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.
 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
 
 import threading
 import vim_db
@@ -45,6 +39,11 @@ import dhcp_thread as dt
 import openflow_thread as oft
 import openflow_conn
 
 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
 
 HTTP_Bad_Request =          400
 HTTP_Unauthorized =         401
index 7eefa8e..cde4d1a 100755 (executable)
@@ -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
     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)
     #obtain PID of program
     component_id=`find_process_id "${om_cmd}" $option_screen_name`
     processes=$(echo $component_id | wc -w)