ftpmaster-dak r1094: Merge transitions fix to work around a syck dump bug
------------------------------------------------------------
revno: 1094
committer: Joerg Jaspert <joerg@debian.org>
branch nick: upstream
timestamp: Mon 2008-05-12 14:14:14 +0200
message:
Merge transitions fix to work around a syck dump bug
modified:
ChangeLog
dak/transitions.py
------------------------------------------------------------
revno: 1093.1.1
committer: Joerg Jaspert <joerg@debian.org>
branch nick: transitions
timestamp: Mon 2008-05-12 13:34:17 +0200
message:
Fix yaml dump bug in syck by using yaml instead
modified:
ChangeLog
dak/transitions.py
------------------------------------------------------------
revno: 1093.1.2
committer: Joerg Jaspert <joerg@debian.org>
branch nick: transitions
timestamp: Mon 2008-05-12 14:06:28 +0200
message:
Also replace dump
modified:
ChangeLog
dak/transitions.py
=== modified file 'ChangeLog'
--- a/ChangeLog 2008-05-10 14:40:26 +0000
+++ b/ChangeLog 2008-05-12 12:06:28 +0000
@@ -1,5 +1,11 @@
+2008-05-12 Joerg Jaspert <joerg@debian.org>
+
+ * dak/transitions.py: use yaml.dump instead of syck.dump, as syck
+ seems to have a bug in its dump(), causing it to write illegal entries
+ And also do this for load.
+
2008-05-10 Stephen Gran <sgran@debian.org>
- * tools/debianqueued-0.9/debianqueued: First pass at a send_mail
+ * tools/debianqueued-0.9/debianqueued: First pass at a send_mail
implementation that sucks less
* Update debian/control to reflect new perl dependency
=== modified file 'dak/transitions.py'
--- a/dak/transitions.py 2008-05-05 19:33:02 +0000
+++ b/dak/transitions.py 2008-05-12 12:06:28 +0000
@@ -28,7 +28,7 @@
from daklib import database
from daklib import utils
from daklib.dak_exceptions import TransitionsError
-import syck
+import yaml
# Globals
Cnf = None
@@ -105,10 +105,10 @@
sourcecontent = sourcefile.read()
failure = False
try:
- trans = syck.load(sourcecontent)
- except syck.error, msg:
+ trans = yaml.load(sourcecontent)
+ except yaml.YAMLError, exc:
# Someone fucked it up
- print "ERROR: %s" % (msg)
+ print "ERROR: %s" % (exc)
return None
# lets do further validation here
@@ -219,7 +219,7 @@
temp_lock = lock_file(trans_temp)
destfile = file(trans_temp, 'w')
- syck.dump(from_trans, destfile)
+ yaml.dump(from_trans, destfile, default_flow_style=False)
destfile.close()
os.rename(trans_temp, trans_file)
@@ -259,7 +259,7 @@
(fd, path) = tempfile.mkstemp("", "transitions", Cnf["Transitions::TempPath"])
os.chmod(path, 0644)
f = open(path, "w")
- syck.dump(transitions, f)
+ yaml.dump(transitions, f, default_flow_style=False)
return path
################################################################################
Reply to: