fixed old log imports and dont bail out on tdma model exception

This commit is contained in:
Blake J. Harnden 2017-08-08 09:17:09 -07:00
parent f3863ead73
commit 67d451c3e9
7 changed files with 20 additions and 14 deletions

View file

@ -84,7 +84,7 @@ AC_SUBST(CORE_DATA_DIR)
AC_ARG_WITH([guiconfdir],
[AS_HELP_STRING([--with-guiconfdir=dir],
[specify GUI configuration directory])],
[CORE_GUI_CONF_DIR="$with_guiconfdir"],
[CORE_GUI_CONF_DIR="$with_guiconfdir"],
[CORE_GUI_CONF_DIR="\${HOME}/.core"])
AC_SUBST(CORE_GUI_CONF_DIR)
AC_ARG_ENABLE([gui],
@ -143,6 +143,8 @@ if test "x$enable_daemon" = "xyes" ; then
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
fi
#AC_CHECK_PROG(dia, dia, yes, no)

View file

@ -24,7 +24,7 @@ from core.enumerations import MessageTypes
from core.enumerations import NodeTlvs
from core.enumerations import RegisterTlvs
from core.enumerations import SessionTlvs
from core.misc import log, structutils
from core.misc import structutils
from core.misc.ipaddress import IpAddress
from core.misc.ipaddress import MacAddress

View file

@ -17,3 +17,5 @@ VIMAGE_BIN = "@vimage_path@/vimage"
QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga"
MOUNT_BIN = "@mount_path@/mount"
UMOUNT_BIN = "@umount_path@/umount"
OVS_BIN = "@ovs_vs_path@/ovs-vsctl"
OVS_FLOW_BIN = "@ovs_of_path@/ovs-ofctl"

View file

@ -3,6 +3,7 @@ tdma.py: EMANE TDMA model bindings for CORE
"""
from core import emane
from core import logger
from core.emane.emanemodel import EmaneModel
from core.emane.universal import EmaneUniversalModel
from core.enumerations import ConfigDataTypes
@ -14,10 +15,9 @@ class EmaneTdmaModel(EmaneModel):
# model name
name = "emane_tdma"
if emane.VERSION >= emane.EMANE101:
xml_path = "/usr/share/emane/xml/models/mac/tdmaeventscheduler"
else:
raise Exception("EMANE TDMA requires EMANE 1.0.1 or greater")
xml_path = "/usr/share/emane/xml/models/mac/tdmaeventscheduler"
if emane.VERSION < emane.EMANE101:
logger.error("EMANE TDMA requires EMANE 1.0.1 or greater")
# MAC parameters
_confmatrix_mac = [

View file

@ -135,12 +135,15 @@ class ServiceManager(object):
for module_name in module_names:
import_statement = "%s.%s" % (base_module, module_name)
logger.info("importing custom service module: %s", import_statement)
module = importlib.import_module(import_statement)
members = inspect.getmembers(module, lambda x: _is_service(module, x))
for member in members:
clazz = member[1]
clazz.on_load()
cls.add(clazz)
try:
module = importlib.import_module(import_statement)
members = inspect.getmembers(module, lambda x: _is_service(module, x))
for member in members:
clazz = member[1]
clazz.on_load()
cls.add(clazz)
except:
logger.exception("unexpected error during import, skipping: %s", import_statement)
class CoreServices(ConfigurableManager):

View file

@ -7,7 +7,6 @@ from core import emane
from core import logger
from core.enumerations import NodeTypes
from core.misc import ipaddress
from core.misc import log
from core.misc import nodeutils
from core.netns import nodes
from core.xml import xmlutils

View file

@ -25,7 +25,7 @@ setup(name="core-python",
"core.xml",
],
install_requires=[
"enum34"
"enum34",
"logzero"
],
setup_requires=[