X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Ftransitions.py;h=68c65b6a070bf9dbe84d3f8a664c95ccd89572d0;hb=fdbef587c29814f97c192de5a8b7e9f09cc45fa4;hp=7409f6f95a0b18154639cf25b62d952d1879cba7;hpb=9a4fb568340b14698947bfa59b309ae0c67c693a;p=dak.git diff --git a/dak/transitions.py b/dak/transitions.py index 7409f6f9..68c65b6a 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -134,7 +134,7 @@ def load_transitions(trans_file): sourcecontent = sourcefile.read() failure = False try: - trans = yaml.load(sourcecontent) + trans = yaml.safe_load(sourcecontent) except yaml.YAMLError as exc: # Someone fucked it up print "ERROR: %s" % (exc) @@ -262,7 +262,7 @@ def write_transitions(from_trans): temp_lock = lock_file(trans_temp) destfile = file(trans_temp, 'w') - yaml.dump(from_trans, destfile, default_flow_style=False) + yaml.safe_dump(from_trans, destfile, default_flow_style=False) destfile.close() os.rename(trans_temp, trans_file) @@ -321,7 +321,7 @@ def temp_transitions_file(transitions): (fd, path) = tempfile.mkstemp("", "transitions", Cnf["Dir::TempPath"]) os.chmod(path, 0o644) f = open(path, "w") - yaml.dump(transitions, f, default_flow_style=False) + yaml.safe_dump(transitions, f, default_flow_style=False) return path ################################################################################