Package: vmdebootstrap
Version: 0.10-1
Severity: normal
Tags: patch

In bug #747373, Nick Daly posted a patch with an additional fix, to move
"open /dev/tty" inside the try block, so that builds can succeed when
TTY device is not available. That bug report had been closed though.

I'm trying to build images with Jenkins, but my builds are failing
because no /dev/tty is available. I attached a patch that just has the
remaining fix for this issue.
diff --git a/vmdebootstrap b/vmdebootstrap
index 78f0982..2e926d8 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -1017,8 +1017,8 @@ append initrd=%(initrd)s root=UUID=%(uuid)s ro %(kserial)s
         logging.debug(
             "%s usage: %s", self.settings['image'],
             self.runcmd(['du', self.settings['image']]))
-        with open('/dev/tty', 'w') as tty:
-            try:
+        try:
+            with open('/dev/tty', 'w') as tty:
                 cliapp.runcmd([script, rootdir, self.settings['image']], stdout=tty, stderr=tty)
             except IOError:
                 subprocess.call([script, rootdir, self.settings['image']])

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to