def instance_timestamp(self, report_id, instance_id): table_name = '%s:%s' % (report_id, instance_id) try: timestamp = self.conn['%s:' % table_name] except KeyError: raise caches.InstanceIncompleteError return decode(timestamp)
def instance_footer(self, report_id, instance_id): if not self.is_instance_finished(report_id, instance_id): raise caches.InstanceIncompleteError footer = self.conn.execute(''' select footer from %s where report_id = ? and instance_id = ? ''' % self.METADATA_TABLE, (report_id, instance_id)) return decode(footer.next()[0])