X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fqueue_report.py;h=1f688919df9bf37f56ef8e637e96aae38ad8ba89;hb=8cb1abe7c2f08bc22fd3ddfcfce55e6183cd297e;hp=d3777a273971cd67e36314c907dee404779a5760;hpb=b43634b6faf221ee10fc63116baead379f68f92f;p=dak.git diff --git a/dak/queue_report.py b/dak/queue_report.py index d3777a27..1f688919 100755 --- a/dak/queue_report.py +++ b/dak/queue_report.py @@ -350,15 +350,17 @@ RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:795 """.strip().split("\n") - rrdtool.create(*create) - rrdtool.update(*update) + try: + rc = rrdtool.create(*create) + ru = rrdtool.update(*update) + except rrdtool.error, e: + print('warning: queue_report: rrdtool error, skipping %s.rrd: %s' % (type, e)) except NameError: pass ############################################################ def process_changes_files(changes_files, type, log, rrd_dir): - #session = DBConn().session() msg = "" cache = {} # Read in all the .changes files @@ -431,7 +433,9 @@ def process_changes_files(changes_files, type, log, rrd_dir): for j in i[1]["list"]: changesbase = os.path.basename(j["filename"]) try: + session = DBConn().session() dbc = session.query(DBChange).filter_by(changesname=changesbase).one() + session.close() except Exception, e: print "Can't find changes file in NEW for %s (%s)" % (changesbase, e) dbc = None @@ -652,12 +656,12 @@ def main(): if Cnf.has_key("Queue-Report::Options::New"): for dir in directories: print """ -

%s, last day

-

%s, last week

-

%s, last month

-

%s, last year

-

%s, last 5 years

-

%s, last 10 years

+

%s, last day

+

%s, last week

+

%s, last month

+

%s, last year

+

%s, last 5 years

+

%s, last 10 years

""" % ((dir,)*12) if Cnf.has_key("Queue-Report::Options::New"):