1
0
mirror of https://github.com/gryf/boxpy.git synced 2025-12-19 13:37:58 +01:00

Minor logging fixes.

This commit is contained in:
2021-06-30 15:31:54 +02:00
parent 0eea78e65e
commit 2d83519b1c

12
box.py
View File

@@ -226,8 +226,8 @@ class Run:
LOG.debug2(result.stderr) LOG.debug2(result.stderr)
self.returncode = result.returncode self.returncode = result.returncode
self.stdout = result.stdout.strip() self.stdout = result.stdout.strip() if result.stdout else ''
self.stderr = result.stderr.strip() self.stderr = result.stderr.strip() if result.stderr else ''
class BoxError(Exception): class BoxError(Exception):
@@ -782,8 +782,7 @@ class Image:
self._img_fname = None self._img_fname = None
def convert_to_vdi(self, disk_img, size): def convert_to_vdi(self, disk_img, size):
LOG.info('Converting and resizing "%s", new size: %sMB', disk_img, LOG.info('Converting and resizing "%s", new size: %s', disk_img, size)
size)
if not self._download_image(): if not self._download_image():
return None return None
if not self._convert_to_raw(): if not self._convert_to_raw():
@@ -1083,7 +1082,10 @@ def vmcreate(args, conf=None):
break break
out = out.split(':')[1].strip() out = out.split(':')[1].strip()
if out != 'done': if out != 'done':
LOG.warning('Cloud init finished with "%s" status.', out) cmd = cmd[:-1]
cmd.append('cloud-init status -l')
LOG.warning('Cloud init finished with "%s" status:\n%s', out,
Run(cmd).stdout)
except KeyboardInterrupt: except KeyboardInterrupt:
LOG.warning('\nIterrupted, cleaning up') LOG.warning('\nIterrupted, cleaning up')