Fix some tests on Windows

This commit is contained in:
Julien Duponchelle committed 2015-04-27 23:12:13 +02:00
1 parent bf3444933e
commit 77f54848e3
8 files changed
+66 -38

No files matched your search

+1
View File
@@ -102,6 +102,7 @@ class Project:
server_config = Config.instance().get_section_config("Server")
path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects"))
path = os.path.normpath(path)
try:
os.makedirs(path, exist_ok=True)
except OSError as e:
+3 -3
View File
@@ -182,12 +182,12 @@ class VPCSVM(BaseVM):
try:
script_file = os.path.join(self.working_dir, 'startup.vpc')
with open(script_file, "w+", encoding="utf-8") as f:
with open(script_file, "wb+") as f:
if startup_script is None:
f.write('')
f.write(b'')
else:
startup_script = startup_script.replace("%h", self._name)
f.write(startup_script)
f.write(startup_script.encode("utf-8"))
except OSError as e:
raise VPCSError('Cannot write the startup script file "{}": {}'.format(self.script_file, e))