Match how IOU initial-config is set for VPCS VM.

This commit is contained in:
grossmj 2015-05-04 21:54:56 -06:00
parent 71e2586e17
commit 9eeb8910fb

View File

@ -181,15 +181,15 @@ class VPCSVM(BaseVM):
""" """
try: try:
script_file = os.path.join(self.working_dir, 'startup.vpc') startup_script_path = os.path.join(self.working_dir, 'startup.vpc')
with open(script_file, "wb+") as f: with open(startup_script_path, "w+", encoding='utf-8') as f:
if startup_script is None: if startup_script is None:
f.write(b'') f.write('')
else: else:
startup_script = startup_script.replace("%h", self._name) startup_script = startup_script.replace("%h", self._name)
f.write(startup_script.encode("utf-8")) f.write(startup_script)
except OSError as e: 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 @asyncio.coroutine
def _check_vpcs_version(self): def _check_vpcs_version(self):