From patchwork Thu Jan 26 04:04:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 6409 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 331BC24280 for ; Thu, 26 Jan 2012 04:04:15 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0D889A182B6 for ; Thu, 26 Jan 2012 04:04:15 +0000 (UTC) Received: by bkar19 with SMTP id r19so158160bka.11 for ; Wed, 25 Jan 2012 20:04:14 -0800 (PST) Received: by 10.205.120.17 with SMTP id fw17mr188130bkc.74.1327550654688; Wed, 25 Jan 2012 20:04:14 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.130.220 with SMTP id u28cs29718bks; Wed, 25 Jan 2012 20:04:14 -0800 (PST) Received: by 10.180.82.5 with SMTP id e5mr1263033wiy.18.1327550653814; Wed, 25 Jan 2012 20:04:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id k42si2336634weq.41.2012.01.25.20.04.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jan 2012 20:04:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RqGZJ-00061C-HU for ; Thu, 26 Jan 2012 04:04:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 7743DE04D0 for ; Thu, 26 Jan 2012 04:04:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 203 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 203: extracted just the fix for timeout issues from https://code.launchpad.net/~le-chi-thu/lava-dispat... Message-Id: <20120126040413.16021.49103.launchpad@ackee.canonical.com> Date: Thu, 26 Jan 2012 04:04:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14719"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: f84e62c9576443c873fec1d7108d28a81886d236 ------------------------------------------------------------ revno: 203 committer: Paul Larson branch nick: lava-dispatcher timestamp: Wed 2012-01-25 21:59:38 -0600 message: extracted just the fix for timeout issues from https://code.launchpad.net/~le-chi-thu/lava-dispatcher/improve-logging-lmc-timeout/+merge/90220 with some slight modification. Raise the original exception from pexpect, if any, so that it will produce better debug output modified: lava_dispatcher/client/lmc_utils.py --- lp:lava-dispatcher https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk You are subscribed to branch lp:lava-dispatcher. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription === modified file 'lava_dispatcher/client/lmc_utils.py' --- lava_dispatcher/client/lmc_utils.py 2012-01-22 22:39:22 +0000 +++ lava_dispatcher/client/lmc_utils.py 2012-01-26 03:59:38 +0000 @@ -111,10 +111,11 @@ cmd += ' --rootfs ' + rootfstype logging.info("Executing the linaro-media-create command") logging.info(cmd) - rc = run_dispatcher_snowball_license_fix(cmd) - if rc: + try: + _run_linaro_media_create(cmd) + except: shutil.rmtree(tarball_dir) - raise RuntimeError("linaro-media-create failed: %s" % output) + raise return image_file def get_partition_offset(image, partno): @@ -145,36 +146,32 @@ logging_system('sudo umount ' + mntdir) logging_system('rm -rf ' + mntdir) -def run_dispatcher_snowball_license_fix(cmd): - try: - proc = pexpect.spawn(cmd, logfile=sys.stdout) - done = False - - while not done: - id = proc.expect(["SNOWBALL CLICK-WRAP", - "Do you accept the", - "Configuring startupfiles", - "Configuring ux500-firmware", - "Configuring lbsd", - "Configuring mali400-dev", - pexpect.EOF], timeout=2400) - if id == 0: +def _run_linaro_media_create(cmd): + proc = pexpect.spawn(cmd, logfile=sys.stdout) + done = False + + while not done: + id = proc.expect(["SNOWBALL CLICK-WRAP", + "Do you accept the", + "Configuring startupfiles", + "Configuring ux500-firmware", + "Configuring lbsd", + "Configuring mali400-dev", + pexpect.EOF], timeout=7200) + if id == 0: + proc.send('\t') + time.sleep(1) + proc.send('\r') + + elif id == 1: + if not mali400: proc.send('\t') - time.sleep(1) - proc.send('\r') - - elif id == 1: - if not mali400: - proc.send('\t') - time.sleep(1) - proc.send('\r') - elif id == 6: - done = True - elif id == 5: - mali400 = True - else: - mali400 = False - except pexpect.ExceptionPexpect: - return 1 - - return 0 + time.sleep(1) + proc.send('\r') + elif id == 6: + done = True + elif id == 5: + mali400 = True + else: + mali400 = False +