From patchwork Fri Jan 11 03:50:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 13968 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 47077240B9 for ; Fri, 11 Jan 2013 03:50:23 +0000 (UTC) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by fiordland.canonical.com (Postfix) with ESMTP id DFDEFA1855A for ; Fri, 11 Jan 2013 03:50:22 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fy27so1062272vcb.27 for ; Thu, 10 Jan 2013 19:50:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:content-type:mime-version:x-launchpad-project :x-launchpad-branch:x-launchpad-message-rationale :x-launchpad-branch-revision-number:x-launchpad-notification-type:to :from:subject:message-id:date:reply-to:sender:errors-to:precedence :x-generated-by:x-launchpad-hash:x-gm-message-state; bh=ILLZgM/RYsZsB1D3bvmWSwx7qvKMMEpT0A7ehEgmNik=; b=YdyMogq8za0anJVHV9O2/jSvSCgOF/SX1Y1KA6pjnGnBnPmNpYCdsN0KR/iP9fTxtQ OOBIT0VdWbkI8ekdcyxED1LBstNx2icjfVGmxM+yCf7B1e5RXejDk4bVF2/TQOO7trNY 8tqXtSMJvtwnCvAc7Nbz1/oSqQV4irJHqYFtk2yha0TP4iKcjPF15H0Wwdw9+JNqaDCo BdFH6RrmcysYj3IoC5PkCekHlUTbm8iOZ6Nq9z3/DD/+llwsT6oQsroL3C+xypmbOe+G f067nGbr/1KSH4BDnMZczt2aq+CjuCu3nCIRw4v+oOkRys2GA1UoQUuwv2HX/9Kv5i7m r9Vg== X-Received: by 10.220.157.9 with SMTP id z9mr93329151vcw.45.1357876222374; Thu, 10 Jan 2013 19:50:22 -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.58.145.101 with SMTP id st5csp94597veb; Thu, 10 Jan 2013 19:50:21 -0800 (PST) X-Received: by 10.180.39.143 with SMTP id p15mr12817541wik.14.1357876220405; Thu, 10 Jan 2013 19:50:20 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id ex7si6674123wid.46.2013.01.10.19.50.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 10 Jan 2013 19:50:20 -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 1TtVdL-0006xJ-Vm for ; Fri, 11 Jan 2013 03:50:19 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E08B2E03F3 for ; Fri, 11 Jan 2013 03:50:19 +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: 524 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 524: hack around some configglue warnings Message-Id: <20130111035019.27453.8759.launchpad@ackee.canonical.com> Date: Fri, 11 Jan 2013 03:50:19 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16412"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 18f5ddc129afd1d7aee1413b2f544946e52648c9 X-Gm-Message-State: ALoCoQnLsNXzll6iOqtHtHEFwJ95BJZsRa09yyDMgZvVmlNV2pPVKFiCsrdGQkdNQcAeA9rZOXKD ------------------------------------------------------------ revno: 524 committer: Andy Doan branch nick: lava-dispatcher timestamp: Thu 2013-01-10 15:37:58 -0600 message: hack around some configglue warnings modified: lava_dispatcher/config.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/config.py' --- lava_dispatcher/config.py 2013-01-04 00:03:43 +0000 +++ lava_dispatcher/config.py 2013-01-10 21:37:58 +0000 @@ -198,6 +198,24 @@ scp.extra_sections = set(scp.get('__main__', 'boot_options')) +def _hack_report(report): + """ + ConfigGlue makes warning for somethings we don't want to warn about. In + particular, it will warn if a value isn't known to the config such as + in the case where you are using config variables or where you define + something like a boot_option for master like "boot_cmds_fdt" + """ + scrubbed = [] + ignores = [ + 'Configuration includes invalid options for section', + ] + for err in report: + for ignore in ignores: + if not err.startswith(ignore): + scrubbed.append(err) + return scrubbed + + def get_device_config(name, config_dir): # We read the device config once to get the device type, then we start # again and read device-defaults, device-types/$device-type and @@ -215,7 +233,11 @@ _hack_boot_options(real_device_config) valid, report = real_device_config.is_valid(report=True) if not valid: - logging.warning("Device config for %s is not valid:\n %s", name, '\n '.join(report)) + report = _hack_report(report) + if len(report) > 0: + report = '\n '.join(report) + logging.warning( + "Device config for %s is not valid:\n %s", name, report) return DeviceConfig(real_device_config)