From patchwork Wed Jan 4 21:26:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 6052 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 E7C7623E10 for ; Wed, 4 Jan 2012 21:26:17 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id CFD70A181FB for ; Wed, 4 Jan 2012 21:26:17 +0000 (UTC) Received: by eaac11 with SMTP id c11so17167150eaa.11 for ; Wed, 04 Jan 2012 13:26:17 -0800 (PST) Received: by 10.205.132.148 with SMTP id hu20mr11214623bkc.96.1325712377105; Wed, 04 Jan 2012 13:26:17 -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.205.82.144 with SMTP id ac16cs382351bkc; Wed, 4 Jan 2012 13:26:16 -0800 (PST) Received: by 10.216.133.234 with SMTP id q84mr31903009wei.30.1325712375108; Wed, 04 Jan 2012 13:26:15 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id n21si5582849wed.13.2012.01.04.13.26.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jan 2012 13:26:15 -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 1RiYLe-0008Rd-Pe for ; Wed, 04 Jan 2012 21:26:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id B5F5AE03B0 for ; Wed, 4 Jan 2012 21:26:14 +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: 187 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 187: put delimiters around the ip address so that we can be sure we are matching all of it Message-Id: <20120104212614.24834.19110.launchpad@ackee.canonical.com> Date: Wed, 04 Jan 2012 21:26:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14616"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 396a72a74dfac39547a5f5e79cab9c78544e5a6c ------------------------------------------------------------ revno: 187 committer: Michael Hudson-Doyle branch nick: get-the-whole-ip-address-bug-906772 timestamp: Thu 2012-01-05 10:16:34 +1300 message: put delimiters around the ip address so that we can be sure we are matching all of it modified: lava_dispatcher/client/master.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/master.py' --- lava_dispatcher/client/master.py 2011-12-19 02:23:53 +0000 +++ lava_dispatcher/client/master.py 2012-01-04 21:16:34 +0000 @@ -220,15 +220,14 @@ logging.warning(traceback.format_exc()) return None #tty device uses minimal match, see pexpect wiki - #pattern1 = ".*\n(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" - pattern1 = "(\d?\d?\d?\.\d?\d?\d?\.\d?\d?\d?\.\d?\d?\d?)" + pattern1 = "<(\d?\d?\d?\.\d?\d?\d?\.\d?\d?\d?\.\d?\d?\d?)>" cmd = ("ifconfig %s | grep 'inet addr' | awk -F: '{print $2}' |" - "awk '{print $1}'" % self._client.default_network_interface) + "awk '{print \"<\" $1 \">\"}'" % self._client.default_network_interface) self.run( cmd, [pattern1, pexpect.EOF, pexpect.TIMEOUT], timeout=5) if self.match_id == 0: logging.info("\nmatching pattern is %s" % self.match_id) - ip = self.match.groups()[0] + ip = self.match.group(1) logging.info("Master IP is %s" % ip) return ip return None