mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
If not script file is setted we use the default from VPCS
This commit is contained in:
1 parent
4b62d4d82c
commit
8bc26420b7
2 files changed
+22
-1
No files matched your search
@@ -165,8 +165,15 @@ class VPCSVM(BaseVM):
|
||||
@property
|
||||
def startup_script(self):
|
||||
"""Return the content of the current startup script"""
|
||||
|
||||
if self._script_file is None:
|
||||
return None
|
||||
# If the default VPCS file exist we use it
|
||||
path = os.path.join(self.working_dir, 'startup.vpc')
|
||||
if os.path.exists(path):
|
||||
self._script_file = path
|
||||
else:
|
||||
return None
|
||||
|
||||
try:
|
||||
with open(self._script_file) as f:
|
||||
return f.read()
|
||||
|
||||
Reference in new issue
Block a user