Changed unmountdmg back to using subprocess.Popen from an earlier change to subprocess.call so that we can capture the output instead of it going to stdout.

git-svn-id: http://munki.googlecode.com/svn/trunk@652 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2010-08-04 17:24:25 +00:00
parent e7ad493e61
commit ba8d9448cc
+5 -2
View File
@@ -433,8 +433,11 @@ def unmountdmg(mountpoint):
"""
Unmounts the dmg at mountpoint
"""
retcode = subprocess.call(['/usr/bin/hdiutil', 'detach', mountpoint])
if retcode:
proc = subprocess.Popen(['/usr/bin/hdiutil', 'detach', mountpoint],
bufsize=1, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(ouptut, err) = proc.communicate()
if proc.returncode:
display_warning("Attempting to force unmount %s" % mountpoint)
# try forcing the unmount
retcode = subprocess.call(['/usr/bin/hdiutil', 'detach', mountpoint,