summaryrefslogtreecommitdiffstats
path: root/cobbler/serializer.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-06-28 16:57:49 -0400
committerJim Meyering <jim@meyering.net>2006-06-28 16:57:49 -0400
commit98bdc7c86a28eafbab15061e9a5d0fd4f5cdace1 (patch)
tree12bc44a95469ee2d75f590c1f637ff12d80d2347 /cobbler/serializer.py
parent662c68e18943d913b503ba86758d91c27f92be98 (diff)
downloadthird_party-cobbler-98bdc7c86a28eafbab15061e9a5d0fd4f5cdace1.tar.gz
third_party-cobbler-98bdc7c86a28eafbab15061e9a5d0fd4f5cdace1.tar.xz
third_party-cobbler-98bdc7c86a28eafbab15061e9a5d0fd4f5cdace1.zip
Make cobbler use the Howell-Evans YAML parser now, so RHEL4 support
will be possible (Syck needs Python 2.4).
Diffstat (limited to 'cobbler/serializer.py')
-rw-r--r--cobbler/serializer.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/cobbler/serializer.py b/cobbler/serializer.py
index 71781b7..d57e74a 100644
--- a/cobbler/serializer.py
+++ b/cobbler/serializer.py
@@ -12,7 +12,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
"""
-import syck # PySyck 0.61 or greater, not syck-python 0.55
+import yaml # Howell-Clark version
import errno
import os
@@ -42,7 +42,7 @@ def serialize(obj):
raise cexceptions.CobblerException("need_perms", filename)
return False
datastruct = obj.to_datastruct()
- encoded = syck.dump(datastruct)
+ encoded = yaml.dump(datastruct)
fd.write(encoded)
fd.close()
return True
@@ -65,11 +65,10 @@ def deserialize(obj):
else:
raise CobblerException("need_perms",obj.filename())
data = fd.read()
- datastruct = syck.load(data)
- if type(datastruct) == str:
- # PySyck returns strings when it chokes on data
- # it doesn't really throw exceptions
- raise CobblerException("parse_error",filename)
+ datastruct = yaml.load(data).next() # first record
+ # leftover from PySyck choke detection. Not relevant?
+ # if type(datastruct) == str:
+ # raise CobblerException("parse_error",filename)
fd.close()
obj.from_datastruct(datastruct)
return True