moved ConfigShim to being under tlv, updated RegisterTlvs to use enums directly in non tlv code

This commit is contained in:
Blake Harnden 2020-03-22 14:59:42 -07:00
parent 7a5a0f34ea
commit 39499a4ab4
14 changed files with 128 additions and 128 deletions

View file

@ -60,7 +60,7 @@ class EmaneManager(ModelManager):
"""
name = "emane"
config_type = RegisterTlvs.EMULATION_SERVER.value
config_type = RegisterTlvs.EMULATION_SERVER
SUCCESS, NOT_NEEDED, NOT_READY = (0, 1, 2)
EVENTCFGVAR = "LIBEMANEEVENTSERVICECONFIG"
DEFAULT_LOG_LEVEL = 3

View file

@ -103,12 +103,12 @@ class EmaneNet(CoreNetworkBase):
set the EmaneModel associated with this node
"""
logging.info("adding model: %s", model.name)
if model.config_type == RegisterTlvs.WIRELESS.value:
if model.config_type == RegisterTlvs.WIRELESS:
# EmaneModel really uses values from ConfigurableManager
# when buildnemxml() is called, not during init()
self.model = model(session=self.session, _id=self.id)
self.model.update_config(config)
elif model.config_type == RegisterTlvs.MOBILITY.value:
elif model.config_type == RegisterTlvs.MOBILITY:
self.mobility = model(session=self.session, _id=self.id)
self.mobility.update_config(config)