X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Ftransitions.py;h=b7e50651e8d4daf7b8d284f89bf4a9e5c0fe10cf;hb=f8996e240d9d0278bce098e23be63db0bcc6fbee;hp=a37dbef9f1da7b8bb27ec3d388114af47b68a214;hpb=f4376ddbdb29017d84f876b06ebf0aed14c4e811;p=dak.git diff --git a/dak/transitions.py b/dak/transitions.py index a37dbef9..b7e50651 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -28,7 +28,7 @@ import apt_pkg 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 @@ def load_transitions(trans_file): 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 @@ def write_transitions(from_trans): 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 @@ def temp_transitions_file(transitions): (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 ################################################################################