You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a snapshot with an underscore in the name (e.g. test_snapshot) results in an error when trying to load the snapshot after the server has restarted:
Traceback (most recent call last):
File "/home/gns3/.venv/gns3server-venv/lib/python3.8/site-packages/gns3server/web/route.py", line 202, in control_schema
func(request, response)
File "/home/gns3/.venv/gns3server-venv/lib/python3.8/site-packages/gns3server/handlers/api/controller/snapshot_handler.py", line 67, in list
response.json(sorted(snapshots, key=lambda s: (s.created_at, s.name)))
File "/home/gns3/.venv/gns3server-venv/lib/python3.8/site-packages/gns3server/handlers/api/controller/snapshot_handler.py", line 67, in <lambda>
response.json(sorted(snapshots, key=lambda s: (s.created_at, s.name)))
File "/home/gns3/.venv/gns3server-venv/lib/python3.8/site-packages/gns3server/controller/snapshot.py", line 80, in created_at
return int(self._created_at)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'datetime.datetime'
This is because the snapshot name is parsed by assuming that everything following the first underscore is the date:
Creating a snapshot with an underscore in the name (e.g.
test_snapshot
) results in an error when trying to load the snapshot after the server has restarted:This is because the snapshot name is parsed by assuming that everything following the first underscore is the date:
gns3-server/gns3server/controller/snapshot.py
Lines 58 to 59 in 35f94b0
A more robust solution might be to simply work backwards from the end of the filename instead using negative indexing:
The text was updated successfully, but these errors were encountered: