diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 365714e3..b697f088 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -326,6 +326,15 @@ class IOUVM(BaseNode): def iourc_content(self, value): if value is not None: + # If we don't save the value in the ~/ the licence is lost at project + # reload + path = os.path.join(os.path.expanduser("~/"), ".iourc") + try: + with open(path, "wb+") as f: + f.write(value.encode("utf-8")) + except OSError as e: + raise IOUError("Could not write the iourc file {}: {}".format(path, e)) + path = os.path.join(self.temporary_directory, "iourc") try: with open(path, "wb+") as f: