+ def _parse_flowcell_id(self, flowcell_row):
+ """
+ Return flowcell id and status
+
+ We stored the status information in the flowcell id name.
+ this was dumb, but database schemas are hard to update.
+ """
+ fields = flowcell_row['flowcell_id'].split()
+ fcid = None
+ status = None
+ if len(fields) > 0:
+ fcid = fields[0]
+ if len(fields) > 1:
+ status = fields[1]
+ return fcid, status
+
+
+def flowcell_gone(cell):
+ """
+ Use a variety of heuristics to determine if the flowcell drive
+ has been deleted.
+ """
+ status = cell['flowcell_status']
+ if status is None:
+ return False
+ failures = ['failed', 'deleted', 'not run']
+ for f in failures:
+ if re.search(f, status):
+ return True
+ else:
+ return False
+