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

@ -143,6 +143,8 @@ if test "x$enable_daemon" = "xyes" ; then
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH) AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
AC_CHECK_PROG(umount_path, umount, $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(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 fi
#AC_CHECK_PROG(dia, dia, yes, no) #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 NodeTlvs
from core.enumerations import RegisterTlvs from core.enumerations import RegisterTlvs
from core.enumerations import SessionTlvs 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 IpAddress
from core.misc.ipaddress import MacAddress 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" QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga"
MOUNT_BIN = "@mount_path@/mount" MOUNT_BIN = "@mount_path@/mount"
UMOUNT_BIN = "@umount_path@/umount" 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 emane
from core import logger
from core.emane.emanemodel import EmaneModel from core.emane.emanemodel import EmaneModel
from core.emane.universal import EmaneUniversalModel from core.emane.universal import EmaneUniversalModel
from core.enumerations import ConfigDataTypes from core.enumerations import ConfigDataTypes
@ -14,10 +15,9 @@ class EmaneTdmaModel(EmaneModel):
# model name # model name
name = "emane_tdma" name = "emane_tdma"
if emane.VERSION >= emane.EMANE101:
xml_path = "/usr/share/emane/xml/models/mac/tdmaeventscheduler" xml_path = "/usr/share/emane/xml/models/mac/tdmaeventscheduler"
else: if emane.VERSION < emane.EMANE101:
raise Exception("EMANE TDMA requires EMANE 1.0.1 or greater") logger.error("EMANE TDMA requires EMANE 1.0.1 or greater")
# MAC parameters # MAC parameters
_confmatrix_mac = [ _confmatrix_mac = [

View file

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

View file

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

View file

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