1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fixes issue when IOURC environment variable is set to None.

This commit is contained in:
Jeremy 2015-03-26 15:11:36 -06:00
parent 879ed9e4e6
commit c7034c25ef

View File

@ -380,8 +380,6 @@ class IOUVM(BaseVM):
return
config = configparser.ConfigParser()
if self.iourc_path is None:
raise IOUError("Could not found iourc file")
try:
with open(self.iourc_path) as f:
config.read_file(f)
@ -439,8 +437,10 @@ class IOUVM(BaseVM):
self._rename_nvram_file()
iourc_path = self.iourc_path
if iourc_path and not os.path.isfile(iourc_path):
raise IOUError("A valid iourc file is necessary to start IOU")
if iourc_path is None:
raise IOUError("Could not find a iourc file (IOU license)")
if not os.path.isfile(iourc_path):
raise IOUError("The iourc path '{}' is not a regular file".format(iourc_path))
yield from self._check_iou_licence()
iouyap_path = self.iouyap_path