mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 10:46:24 +00:00
Catch error when writting the topology file on read only device
Fix #1003
This commit is contained in:
parent
31d1696215
commit
8e5f7d0838
@ -146,8 +146,11 @@ def load_topology(path):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
if changed:
|
if changed:
|
||||||
|
try:
|
||||||
with open(path, "w+", encoding="utf-8") as f:
|
with open(path, "w+", encoding="utf-8") as f:
|
||||||
json.dump(topo, f, indent=4, sort_keys=True)
|
json.dump(topo, f, indent=4, sort_keys=True)
|
||||||
|
except (OSError) as e:
|
||||||
|
raise aiohttp.web.HTTPConflict(text="Can't write the topology {}: {}".format(path, str(e)))
|
||||||
return topo
|
return topo
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user