Commit 35d47a23 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Add missing `raise' keywords

There were cases where a FatalError exception was constructed but never
raised
parent d05e19af
......@@ -391,13 +391,12 @@ class Windows(OSBase):
if m:
querymax = m.group(1)
else:
FatalError(
"Unexpected output for `shrink querymax' command: %s" %
line)
raise FatalError("Unexpected output for `shrink querymax' "
"command: %s" % line)
if querymax is None:
FatalError("Error in shrinking! "
"Couldn't find the max number of reclaimable bytes!")
raise FatalError("Error in shrinking! Couldn't find the max "
"number of reclaimable bytes!")
querymax = int(querymax)
# From ntfsresize:
......@@ -426,9 +425,9 @@ class Windows(OSBase):
stdout, stderr, rc = self.vm.rexec(cmd, fatal=False)
if rc != 0:
FatalError("Shrinking failed. Please make sure the media is "
"defraged with a command like this: "
"`Defrag.exe /U /X /W'")
raise FatalError("Shrinking failed. Please make sure the media is "
"defraged with a command like this: "
"`Defrag.exe /U /X /W'")
for line in stdout.splitlines():
if line.find('shrunk') >= 0:
self.out.output(" %s" % line)
......
......@@ -46,7 +46,7 @@ class VM(object):
kvm, needed_args = get_kvm_binary()
if kvm is None:
FatalError("Can't find the kvm binary")
raise FatalError("Can't find the kvm binary")
self.kvm = [kvm] + list(needed_args)
......@@ -235,7 +235,7 @@ class VM(object):
try:
(stdout, stderr, rc) = winexe.run(command)
except WinexeTimeout:
FatalError("Command: `%s' timeout out." % command)
raise FatalError("Command: `%s' timeout out." % command)
if rc != 0 and fatal:
log = tempfile.NamedTemporaryFile(delete=False)
......
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