Commit 062dedef authored by Nikos Skalkotos's avatar Nikos Skalkotos

Fix minor pylint warning and output messages

parent 1aa0184e
...@@ -489,7 +489,7 @@ def create_image(session, answers): ...@@ -489,7 +489,7 @@ def create_image(session, answers):
text = "The %s image was successfully uploaded to the storage service " \ text = "The %s image was successfully uploaded to the storage service " \
"and registered with the compute service of %s. Would you like " \ "and registered with the compute service of %s. Would you like " \
"to keep a local copy?" % \ "to keep a local copy?" % \
(answers['Cloud'], answers['RegistrationType'].lower()) (answers['RegistrationType'].lower(), answers['Cloud'])
if not session['dialog'].yesno(text, width=PAGE_WIDTH): if not session['dialog'].yesno(text, width=PAGE_WIDTH):
extract_image(session) extract_image(session)
......
...@@ -152,8 +152,8 @@ class Disk(object): ...@@ -152,8 +152,8 @@ class Disk(object):
"""Creates a snapshot of the original source media of the Disk """Creates a snapshot of the original source media of the Disk
instance. instance.
""" """
self.out.output("Snapshotting media source ...", False)
size = blockdev('--getsz', self.device) size = blockdev('--getsz', self.device)
self.out.output("Snapshotting media source ...", False)
cowfd, cow = tempfile.mkstemp(dir=self.tmp) cowfd, cow = tempfile.mkstemp(dir=self.tmp)
os.close(cowfd) os.close(cowfd)
self._add_cleanup(os.unlink, cow) self._add_cleanup(os.unlink, cow)
...@@ -165,8 +165,9 @@ class Disk(object): ...@@ -165,8 +165,9 @@ class Disk(object):
tablefd, table = tempfile.mkstemp() tablefd, table = tempfile.mkstemp()
try: try:
try: try:
os.write(tablefd, "0 %d snapshot %s %s n 8" % os.write(tablefd,
(int(size), self.device, cowdev)) "0 %d snapshot %s %s n 8" %
(int(size), self.device, cowdev))
finally: finally:
os.close(tablefd) os.close(tablefd)
......
...@@ -549,7 +549,7 @@ class Windows(OSBase): ...@@ -549,7 +549,7 @@ class Windows(OSBase):
# Since the password is reset when logging in, sleep a little # Since the password is reset when logging in, sleep a little
# bit before checking the connectivity, to avoid race # bit before checking the connectivity, to avoid race
# conditions # conditions
time.sleep(2) time.sleep(5)
self.out.output("Checking connectivity to the VM ...", False) self.out.output("Checking connectivity to the VM ...", False)
self._check_connectivity() self._check_connectivity()
...@@ -835,7 +835,7 @@ class Windows(OSBase): ...@@ -835,7 +835,7 @@ class Windows(OSBase):
""" """
with self.mount(readonly=False, silent=True): with self.mount(readonly=False, silent=True):
# Reset Password # Reset Password
self._add_cleanup('virtio',self.registry.reset_passwd, self._add_cleanup('virtio', self.registry.reset_passwd,
self.vm.admin.rid, self.vm.admin.rid,
self.registry.reset_passwd(self.vm.admin.rid)) self.registry.reset_passwd(self.vm.admin.rid))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment