Merge lp:~doanac/lava-dispatcher/configglue-warnings-hack into lp:lava-dispatcher

Proposed by Andy Doan
Status: Merged
Merged at revision: 524
Proposed branch: lp:~doanac/lava-dispatcher/configglue-warnings-hack
Merge into: lp:lava-dispatcher
Diff against target: 67 lines (+30/-2)
3 files modified
doc/changes.rst (+6/-0)
lava_dispatcher/__init__.py (+1/-1)
lava_dispatcher/config.py (+23/-1)
To merge this branch: bzr merge lp:~doanac/lava-dispatcher/configglue-warnings-hack
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+142785@code.launchpad.net

Description of the change

its ugly, but it helps avoid some annoying messages from configglue.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

+1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/changes.rst'
2--- doc/changes.rst 2013-01-10 02:57:27 +0000
3+++ doc/changes.rst 2013-01-10 21:40:32 +0000
4@@ -1,6 +1,12 @@
5 Version History
6 ***************
7
8+.. _verison_0_30:
9+
10+Version 0.30
11+============
12+* Unreleased
13+
14 .. _verison_0_29:
15
16 Version 0.29
17
18=== modified file 'lava_dispatcher/__init__.py'
19--- lava_dispatcher/__init__.py 2013-01-10 03:12:48 +0000
20+++ lava_dispatcher/__init__.py 2013-01-10 21:40:32 +0000
21@@ -18,4 +18,4 @@
22 # along
23 # with this program; if not, see <http://www.gnu.org/licenses>.
24
25-__version__ = (0, 29, 1, "final", 0)
26+__version__ = (0, 30, 0, "dev", 0)
27
28=== modified file 'lava_dispatcher/config.py'
29--- lava_dispatcher/config.py 2013-01-04 00:03:43 +0000
30+++ lava_dispatcher/config.py 2013-01-10 21:40:32 +0000
31@@ -198,6 +198,24 @@
32 scp.extra_sections = set(scp.get('__main__', 'boot_options'))
33
34
35+def _hack_report(report):
36+ """
37+ ConfigGlue makes warning for somethings we don't want to warn about. In
38+ particular, it will warn if a value isn't known to the config such as
39+ in the case where you are using config variables or where you define
40+ something like a boot_option for master like "boot_cmds_fdt"
41+ """
42+ scrubbed = []
43+ ignores = [
44+ 'Configuration includes invalid options for section',
45+ ]
46+ for err in report:
47+ for ignore in ignores:
48+ if not err.startswith(ignore):
49+ scrubbed.append(err)
50+ return scrubbed
51+
52+
53 def get_device_config(name, config_dir):
54 # We read the device config once to get the device type, then we start
55 # again and read device-defaults, device-types/$device-type and
56@@ -215,7 +233,11 @@
57 _hack_boot_options(real_device_config)
58 valid, report = real_device_config.is_valid(report=True)
59 if not valid:
60- logging.warning("Device config for %s is not valid:\n %s", name, '\n '.join(report))
61+ report = _hack_report(report)
62+ if len(report) > 0:
63+ report = '\n '.join(report)
64+ logging.warning(
65+ "Device config for %s is not valid:\n %s", name, report)
66
67 return DeviceConfig(real_device_config)
68

Subscribers

People subscribed via source and target branches