mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 03:19:48 +00:00
Stringify firmware datetime
With the change to msgpack, datetime objects cannot be serialized. Apply tlvdata compliant transform before storing.
This commit is contained in:
parent
91fa5bd1eb
commit
bb9c2297c9
@ -1501,6 +1501,12 @@ class Firmware(ConfluentMessage):
|
||||
readonly = True
|
||||
|
||||
def __init__(self, data, name):
|
||||
for datum in data:
|
||||
for component in datum:
|
||||
for field in datum[component]:
|
||||
tdatum = datum[component]
|
||||
if isinstance(tdatum[field], datetime):
|
||||
tdatum[field] = tdatum[field].strftime('%Y-%m-%dT%H:%M:%S')
|
||||
self.myargs = (data, name)
|
||||
self.notnode = name is None
|
||||
self.desc = 'Firmware information'
|
||||
|
Loading…
Reference in New Issue
Block a user