From: Chris Lamb Date: Thu, 29 Oct 2009 13:43:37 +0000 (+0000) Subject: Check that we can parse the YAML file before we symlink anything. X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=commitdiff_plain;h=f120dedafe5172c94de80dc4b5ca676cae4807e7 Check that we can parse the YAML file before we symlink anything. Signed-off-by: Chris Lamb --- diff --git a/daklib/queue.py b/daklib/queue.py index 8ab693a8..61e2df05 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -1214,6 +1214,16 @@ class Upload(object): # We don't have a tagfile, so just don't do anything. return + # Parse the yaml file + sourcefile = file(tagfile, 'r') + sourcecontent = sourcefile.read() + sourcefile.close() + try: + lintiantags = yaml.load(sourcecontent)['lintian'] + except yaml.YAMLError, msg: + utils.fubar("Can not read the lintian tags file %s, YAML error: %s." % (tagfile, msg)) + return + # Try and find all orig mentioned in the .dsc target_dir = '.' symlinked = [] @@ -1281,16 +1291,6 @@ class Upload(object): if symlink_if_valid(queuefile_path): break - # Parse the yaml file - sourcefile = file(tagfile, 'r') - sourcecontent = sourcefile.read() - sourcefile.close() - try: - lintiantags = yaml.load(sourcecontent)['lintian'] - except yaml.YAMLError, msg: - utils.fubar("Can not read the lintian tags file %s, YAML error: %s." % (tagfile, msg)) - return - # Now setup the input file for lintian. lintian wants "one tag per line" only, # so put it together like it. We put all types of tags in one file and then sort # through lintians output later to see if its a fatal tag we detected, or not.