Merge branch 'master' into 1.5

This commit is contained in:
Julien Duponchelle committed 2016-02-08 13:14:30 +01:00
commit f6fb0623be
29 files changed
+167 -85

No files matched your search

+8 -7
View File
@@ -72,7 +72,6 @@ class IOUVM(BaseVM):
super().__init__(name, vm_id, project, manager, console=console)
self._command = []
self._iouyap_process = None
self._iou_process = None
self._iou_stdout_file = ""
@@ -220,7 +219,8 @@ class IOUVM(BaseVM):
"startup_config": self.relative_startup_config_file,
"private_config": self.relative_private_config_file,
"iourc_path": self.iourc_path,
"use_default_iou_values": self._use_default_iou_values}
"use_default_iou_values": self._use_default_iou_values,
"command_line": self.command_line}
# return the relative path if the IOU image is in the images_path directory
iou_vm_info["path"] = self.manager.get_relative_image_path(self.path)
@@ -403,9 +403,9 @@ class IOUVM(BaseVM):
raise IOUError("Hostname \"{}\" not found in iourc file {}".format(hostname, self.iourc_path))
user_ioukey = config["license"][hostname]
if user_ioukey[-1:] != ';':
raise IOUError("IOU key not ending with ; in iourc file".format(self.iourc_path))
raise IOUError("IOU key not ending with ; in iourc file {}".format(self.iourc_path))
if len(user_ioukey) != 17:
raise IOUError("IOU key length is not 16 characters in iourc file".format(self.iourc_path))
raise IOUError("IOU key length is not 16 characters in iourc file {}".format(self.iourc_path))
user_ioukey = user_ioukey[:16]
# We can't test this because it's mean distributing a valid licence key
@@ -502,13 +502,14 @@ class IOUVM(BaseVM):
if "IOURC" not in os.environ:
env["IOURC"] = iourc_path
self._command = yield from self._build_command()
command = yield from self._build_command()
try:
log.info("Starting IOU: {}".format(self._command))
log.info("Starting IOU: {}".format(command))
self._iou_stdout_file = os.path.join(self.working_dir, "iou.log")
log.info("Logging to {}".format(self._iou_stdout_file))
with open(self._iou_stdout_file, "w", encoding="utf-8") as fd:
self._iou_process = yield from asyncio.create_subprocess_exec(*self._command,
self.command_line = ' '.join(command)
self._iou_process = yield from asyncio.create_subprocess_exec(*command,
stdout=fd,
stderr=subprocess.STDOUT,
cwd=self.working_dir,