diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-05-05 18:30:44 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-05-05 18:30:44 -0400 |
commit | c1aea64f02ae55d47c18269895717af99839ed0e (patch) | |
tree | be13cc5c96d135cd8a08fd0794507650a55ad35b /cobbler/settings.py | |
parent | 3e38df5996d007b4eedc65c4b357502f3e03b604 (diff) | |
download | cobbler-c1aea64f02ae55d47c18269895717af99839ed0e.tar.gz cobbler-c1aea64f02ae55d47c18269895717af99839ed0e.tar.xz cobbler-c1aea64f02ae55d47c18269895717af99839ed0e.zip |
Interim commit during refactoring. Pretty broken as a result of some cleanup but it will get straightened out very soon. The main thing I'm doing here is to remove backreferences from the object tree and make the API simpler, so that folks using the API screw up less. This means making the CLI code simpler as well. The serializer has also been overhauled so it's not as much bolted on, although I have some fixing to do to make it work entirely correctly. Wanted to check all of this in case someone decided to patch something else, making diffing really complex in the interim. I'd recommend not patching anything else to this code as I'm not close to done, really.
Diffstat (limited to 'cobbler/settings.py')
-rw-r--r-- | cobbler/settings.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cobbler/settings.py b/cobbler/settings.py index 79b09e1f..99ebd7d0 100644 --- a/cobbler/settings.py +++ b/cobbler/settings.py @@ -5,7 +5,7 @@ Cobbler app-wide settings """ class Settings(serializable.Serializable): - + def filename(self): return "/var/lib/cobbler/settings" @@ -22,18 +22,21 @@ class Settings(serializable.Serializable): "dhcpd_bin" : "/usr/sbin/dhcpd", "kernel_options" : "append devfs=nomount ramdisk_size=16438 lang= vga=788 ksdevice=eth0", "tftpd_conf" : "/etc/xinetd.d/tftp", - "tftpboot" : "/tftpboot", - } - + "tftpboot" : "/tftpboot", + } + - def to_datastruct(): - return self._attributes() + def to_datastruct(self): + return self._attributes - def from_datastruct(datastruct): - self._attributes = datastruct + def from_datastruct(self,datastruct): + if datastruct is None: + print "DEBUG: not loading empty structure" + return + self._attributes = datastruct def __getattr__(self,name): - if name in self._attributes: + if self._attributes.has_key(name): return self._attributes[name] else: raise AttributeError, name |