diff --git a/migrations/006_populate_rebuilds_from_rawdata.py b/migrations/006_populate_rebuilds_from_rawdata.py index 839ae61..e2111b3 100644 --- a/migrations/006_populate_rebuilds_from_rawdata.py +++ b/migrations/006_populate_rebuilds_from_rawdata.py @@ -58,8 +58,9 @@ def add_past_usage(raws): if processed % 50 == 0: next_update = last_update + datetime.timedelta(seconds=30) if datetime.datetime.utcnow() > next_update: - (processed, count - processed, float(processed) / count) - print "%s processed, %s to go, %.2f percent done" + values = (processed, count - processed, + (float(processed) / count) * 100) + print "%s processed, %s to go, %.2f percent done" % values print "completed processing %s events" % count diff --git a/migrations/008_exists_audit_period.py b/migrations/008_exists_audit_period.py index 4e931f0..b661f62 100644 --- a/migrations/008_exists_audit_period.py +++ b/migrations/008_exists_audit_period.py @@ -27,8 +27,11 @@ def print_update(total, completed, errored): to_go = total - (completed + errored) print "%s populated, %s to go, %s errored" % (completed, to_go, errored) - -exists = models.InstanceExists.objects.all() +filters = { + 'audit_period_beginning__exact': None, + 'audit_period_ending__exact': None +} +exists = models.InstanceExists.objects.filter(**filters) count = exists.count() start = datetime.datetime.utcnow()