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
=== modified file 'doc/changes.rst'
--- doc/changes.rst 2013-01-10 02:57:27 +0000
+++ doc/changes.rst 2013-01-10 21:40:32 +0000
@@ -1,6 +1,12 @@
1Version History1Version History
2***************2***************
33
4.. _verison_0_30:
5
6Version 0.30
7============
8* Unreleased
9
4.. _verison_0_29:10.. _verison_0_29:
511
6Version 0.2912Version 0.29
713
=== modified file 'lava_dispatcher/__init__.py'
--- lava_dispatcher/__init__.py 2013-01-10 03:12:48 +0000
+++ lava_dispatcher/__init__.py 2013-01-10 21:40:32 +0000
@@ -18,4 +18,4 @@
18# along18# along
19# with this program; if not, see <http://www.gnu.org/licenses>.19# with this program; if not, see <http://www.gnu.org/licenses>.
2020
21__version__ = (0, 29, 1, "final", 0)21__version__ = (0, 30, 0, "dev", 0)
2222
=== 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:40:32 +0000
@@ -198,6 +198,24 @@
198 scp.extra_sections = set(scp.get('__main__', 'boot_options'))198 scp.extra_sections = set(scp.get('__main__', 'boot_options'))
199199
200200
201def _hack_report(report):
202 """
203 ConfigGlue makes warning for somethings we don't want to warn about. In
204 particular, it will warn if a value isn't known to the config such as
205 in the case where you are using config variables or where you define
206 something like a boot_option for master like "boot_cmds_fdt"
207 """
208 scrubbed = []
209 ignores = [
210 'Configuration includes invalid options for section',
211 ]
212 for err in report:
213 for ignore in ignores:
214 if not err.startswith(ignore):
215 scrubbed.append(err)
216 return scrubbed
217
218
201def get_device_config(name, config_dir):219def get_device_config(name, config_dir):
202 # We read the device config once to get the device type, then we start220 # We read the device config once to get the device type, then we start
203 # again and read device-defaults, device-types/$device-type and221 # again and read device-defaults, device-types/$device-type and
@@ -215,7 +233,11 @@
215 _hack_boot_options(real_device_config)233 _hack_boot_options(real_device_config)
216 valid, report = real_device_config.is_valid(report=True)234 valid, report = real_device_config.is_valid(report=True)
217 if not valid:235 if not valid:
218 logging.warning("Device config for %s is not valid:\n %s", name, '\n '.join(report))236 report = _hack_report(report)
237 if len(report) > 0:
238 report = '\n '.join(report)
239 logging.warning(
240 "Device config for %s is not valid:\n %s", name, report)
219241
220 return DeviceConfig(real_device_config)242 return DeviceConfig(real_device_config)
221243

Subscribers

People subscribed via source and target branches