mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Fix some tests on Windows
This commit is contained in:
1 parent
bf3444933e
commit
77f54848e3
8 files changed
+66
-38
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in new issue
Block a user