# 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
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')
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)"
)
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:
port=None
port_admin = None
- config_file = 'openvimd.cfg'
+ config_file = 'osm_openvim/openvimd.cfg'
log_file = None
db_name = None
# 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
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
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)