From 062dedef09c620fb9efaf872081d7315b4fd231f Mon Sep 17 00:00:00 2001 From: Nikos Skalkotos Date: Mon, 4 Aug 2014 17:01:44 +0300 Subject: [PATCH] Fix minor pylint warning and output messages --- image_creator/dialog_wizard.py | 2 +- image_creator/disk.py | 7 ++++--- image_creator/os_type/windows/__init__.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/image_creator/dialog_wizard.py b/image_creator/dialog_wizard.py index ee2fcef..4d5e0dd 100644 --- a/image_creator/dialog_wizard.py +++ b/image_creator/dialog_wizard.py @@ -489,7 +489,7 @@ def create_image(session, answers): text = "The %s image was successfully uploaded to the storage service " \ "and registered with the compute service of %s. Would you like " \ "to keep a local copy?" % \ - (answers['Cloud'], answers['RegistrationType'].lower()) + (answers['RegistrationType'].lower(), answers['Cloud']) if not session['dialog'].yesno(text, width=PAGE_WIDTH): extract_image(session) diff --git a/image_creator/disk.py b/image_creator/disk.py index d2212c2..2dc24e2 100644 --- a/image_creator/disk.py +++ b/image_creator/disk.py @@ -152,8 +152,8 @@ class Disk(object): """Creates a snapshot of the original source media of the Disk instance. """ - self.out.output("Snapshotting media source ...", False) size = blockdev('--getsz', self.device) + self.out.output("Snapshotting media source ...", False) cowfd, cow = tempfile.mkstemp(dir=self.tmp) os.close(cowfd) self._add_cleanup(os.unlink, cow) @@ -165,8 +165,9 @@ class Disk(object): tablefd, table = tempfile.mkstemp() try: try: - os.write(tablefd, "0 %d snapshot %s %s n 8" % - (int(size), self.device, cowdev)) + os.write(tablefd, + "0 %d snapshot %s %s n 8" % + (int(size), self.device, cowdev)) finally: os.close(tablefd) diff --git a/image_creator/os_type/windows/__init__.py b/image_creator/os_type/windows/__init__.py index aca35bf..47de2b9 100644 --- a/image_creator/os_type/windows/__init__.py +++ b/image_creator/os_type/windows/__init__.py @@ -549,7 +549,7 @@ class Windows(OSBase): # Since the password is reset when logging in, sleep a little # bit before checking the connectivity, to avoid race # conditions - time.sleep(2) + time.sleep(5) self.out.output("Checking connectivity to the VM ...", False) self._check_connectivity() @@ -835,7 +835,7 @@ class Windows(OSBase): """ with self.mount(readonly=False, silent=True): # Reset Password - self._add_cleanup('virtio',self.registry.reset_passwd, + self._add_cleanup('virtio', self.registry.reset_passwd, self.vm.admin.rid, self.registry.reset_passwd(self.vm.admin.rid)) -- GitLab