From 9eeb8910fb472da5d3e955f9891906a6aa35333b Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 4 May 2015 21:54:56 -0600 Subject: [PATCH] Match how IOU initial-config is set for VPCS VM. --- gns3server/modules/vpcs/vpcs_vm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gns3server/modules/vpcs/vpcs_vm.py b/gns3server/modules/vpcs/vpcs_vm.py index cb7229d7..2f001ced 100644 --- a/gns3server/modules/vpcs/vpcs_vm.py +++ b/gns3server/modules/vpcs/vpcs_vm.py @@ -181,15 +181,15 @@ class VPCSVM(BaseVM): """ try: - script_file = os.path.join(self.working_dir, 'startup.vpc') - with open(script_file, "wb+") as f: + startup_script_path = os.path.join(self.working_dir, 'startup.vpc') + with open(startup_script_path, "w+", encoding='utf-8') as f: if startup_script is None: - f.write(b'') + f.write('') else: startup_script = startup_script.replace("%h", self._name) - f.write(startup_script.encode("utf-8")) + f.write(startup_script) except OSError as e: - raise VPCSError('Cannot write the startup script file "{}": {}'.format(self.script_file, e)) + raise VPCSError('Cannot write the startup script file "{}": {}'.format(startup_script_path, e)) @asyncio.coroutine def _check_vpcs_version(self):