From: Neil Williams Date: Sun, 4 Jan 2015 12:12:35 +0000 (+0000) Subject: Allow builds without a tty X-Git-Url: https://git.siccegge.de//index.cgi?p=forks%2Fvmdebootstrap.git;a=commitdiff_plain;h=48cd527760b1621dc68d7ad27b04c586532fe60f Allow builds without a tty Closes: #747373 Patch from Nick Daly --- diff --git a/vmdebootstrap b/vmdebootstrap index 7ac8807..9247e6b 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -743,7 +743,10 @@ append initrd=%(initrd)s root=UUID=%(uuid)s ro %(kserial)s self.message('Running customize script %s' % script) logging.info("rootdir=%s image=%s", rootdir, self.settings['image']) with open('/dev/tty', 'w') as tty: - cliapp.runcmd([script, rootdir, self.settings['image']], stdout=tty, stderr=tty) + try: + cliapp.runcmd([script, rootdir, self.settings['image']], stdout=tty, stderr=tty) + except IOError as e: + subprocess.call([script, rootdir, self.settings['image']]) def create_tarball(self, rootdir): # Create a tarball of the disk's contents