Add ability to specify default values for all specs and add rel_type=default to it
authorAndrew Gaffney <agaffney@gentoo.org>
Sat, 12 Sep 2009 05:13:14 +0000 (00:13 -0500)
committerAndrew Gaffney <agaffney@gentoo.org>
Sat, 12 Sep 2009 05:13:14 +0000 (00:13 -0500)
ChangeLog
modules/catalyst/config.py

index 4f9ac4008d1d20790f49c2ab16ad3d11ef8ef4fa..bc5acbc0320b8205a1d474b73756ab3d694bdd72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
 # Distributed under the GPL v2
 # $Id$
 
+  12 Sep 2009; Andrew Gaffney <agaffney@gentoo.org>
+  modules/catalyst/config.py:
+  Add ability to specify default values for all specs and add
+  rel_type=default to it
+
   12 Sep 2009; Andrew Gaffney <agaffney@gentoo.org>
   modules/catalyst/target/generic_stage.py:
   Set a default value for livecd/iso
index 5a06ffe949fd3542f6616d01e0cf24579fec6090..f2aabad45a9089b4b3fe02213b969b4caf04e32f 100644 (file)
@@ -135,6 +135,10 @@ class ConfigParser(ParserBase):
 class Spec:
 
        special_prefixes = ('boot', )
+       default_values = {
+               # Do we really still need this?
+               'rel_type': 'default'
+       }
 
        def __init__(self, values=None):
                self.values = { 'global': {} }
@@ -159,7 +163,9 @@ class Spec:
                self.target = target
 
        def get_values(self, target=None):
-               tmp = self.values['global']
+               tmp = {}
+               tmp.update(self.default_values)
+               tmp.update(self.values['global'])
                if target is None:
                        target = self.target
                        tmp['target'] = target