projects
/
snf-image-creator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aca3e65
)
Print a meaningful msg if windows shrinking fails
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Fri, 2 Aug 2013 12:40:36 +0000
(15:40 +0300)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Fri, 2 Aug 2013 12:40:36 +0000
(15:40 +0300)
image_creator/os_type/windows.py
patch
|
blob
|
history
diff --git
a/image_creator/os_type/windows.py
b/image_creator/os_type/windows.py
index
9b5d79f
..
5d56a05
100644
(file)
--- a/
image_creator/os_type/windows.py
+++ b/
image_creator/os_type/windows.py
@@
-124,7
+124,7
@@
class Windows(OSBase):
# because we cannot get the drive letter mapping from a guest.
if check_guestfs_version(self.image.g, 1, 17, 18) < 0:
raise FatalError(
# because we cannot get the drive letter mapping from a guest.
if check_guestfs_version(self.image.g, 1, 17, 18) < 0:
raise FatalError(
- 'For windows support libguestfs 1.17.17 or above is needed')
+ 'For windows support libguestfs 1.17.18 or above is needed')
device = self.image.g.part_to_dev(self.root)
device = self.image.g.part_to_dev(self.root)
@@
-275,8
+275,12
@@
class Windows(OSBase):
r'IF NOT !ERRORLEVEL! EQU 0 EXIT /B 1 & ' +
r'DEL /Q %SCRIPT%"')
r'IF NOT !ERRORLEVEL! EQU 0 EXIT /B 1 & ' +
r'DEL /Q %SCRIPT%"')
- stdout, stderr, rc = self._guest_exec(cmd)
+ stdout, stderr, rc = self._guest_exec(cmd, False)
+ if rc != 0:
+ 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(line)
for line in stdout.splitlines():
if line.find('shrunk') >= 0:
self.out.output(line)