diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 477: fix config warnings for boot_options

Message ID 20121203012314.548.90962.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Andy Doan Dec. 3, 2012, 1:23 a.m. UTC
------------------------------------------------------------
revno: 477
committer: Andy Doan <andy.doan@linaro.org>
branch nick: config-warnings
timestamp: Sun 2012-12-02 11:40:55 -0600
message:
  fix config warnings for boot_options
  
  Our boot_options stuff is kind of self-defining. ie - each item in
  the list requires a section by that name. Configglue doesn't have
  a great way to validate that schema-wise, but we can ignore these
  sections.
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
diff mbox

Patch

=== modified file 'lava_dispatcher/config.py'
--- lava_dispatcher/config.py	2012-11-30 19:14:23 +0000
+++ lava_dispatcher/config.py	2012-12-02 17:40:55 +0000
@@ -172,6 +172,15 @@ 
     return DispatcherConfig(cp, config_dir)
 
 
+def _hack_boot_options(scp):
+    """
+    Boot options are built by creating sections for each item in the
+    boot_options list. Those sections are managed by
+    lava_dispatcher.device.boot_options so we ignore here
+    """
+    scp.extra_sections = set(scp.get('__main__', 'boot_options'))
+
+
 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
@@ -186,6 +195,7 @@ 
         config_dir, real_device_config)
     _get_config("devices/%s" % name, config_dir, real_device_config)
     real_device_config.set("__main__", "hostname", name)
+    _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))