fixed issue with converting lat/lon/alts to float in corehandlers.py and a bad logging statement in coreemu.py
This commit is contained in:
parent
ccdf4a2513
commit
75ea42b2e8
2 changed files with 12 additions and 7 deletions
|
@ -22,7 +22,7 @@ from core.data import FileData
|
|||
from core.emulator.emudata import InterfaceData
|
||||
from core.emulator.emudata import LinkOptions
|
||||
from core.emulator.emudata import NodeOptions
|
||||
from core.enumerations import ConfigDataTypes, ExceptionLevels
|
||||
from core.enumerations import ConfigDataTypes
|
||||
from core.enumerations import ConfigFlags
|
||||
from core.enumerations import ConfigTlvs
|
||||
from core.enumerations import EventTlvs
|
||||
|
@ -645,11 +645,16 @@ class CoreHandler(SocketServer.BaseRequestHandler):
|
|||
y=message.get_tlv(NodeTlvs.Y_POSITION.value)
|
||||
)
|
||||
|
||||
node_options.set_location(
|
||||
lat=message.get_tlv(NodeTlvs.LATITUDE.value),
|
||||
lon=message.get_tlv(NodeTlvs.LONGITUDE.value),
|
||||
alt=message.get_tlv(NodeTlvs.ALTITUDE.value)
|
||||
)
|
||||
lat = message.get_tlv(NodeTlvs.LATITUDE.value)
|
||||
if lat is not None:
|
||||
lat = float(lat)
|
||||
lon = message.get_tlv(NodeTlvs.LONGITUDE.value)
|
||||
if lon is not None:
|
||||
lon = float(lon)
|
||||
alt = message.get_tlv(NodeTlvs.ALTITUDE.value)
|
||||
if alt is not None:
|
||||
alt = float(alt)
|
||||
node_options.set_location(lat=lat, lon=lon, alt=alt)
|
||||
|
||||
node_options.icon = message.get_tlv(NodeTlvs.ICON.value)
|
||||
node_options.canvas = message.get_tlv(NodeTlvs.CANVAS.value)
|
||||
|
|
|
@ -542,7 +542,7 @@ class EmuSession(Session):
|
|||
# set node as updated successfully
|
||||
result = True
|
||||
except KeyError:
|
||||
logger.error("failure to update node that does not exist: %s", node_options.id)
|
||||
logger.error("failure to update node that does not exist: %s", node_id)
|
||||
|
||||
return result
|
||||
|
||||
|
|
Loading…
Reference in a new issue