Don't die if Config/FlowcellId.xml is missing warn the user and continue
authorDiane Trout <diane@caltech.edu>
Tue, 1 Apr 2008 21:30:40 +0000 (21:30 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 1 Apr 2008 21:30:40 +0000 (21:30 +0000)
scripts/runfolder.py

index 29b372be9056a9046a824158c44ecd36f2b16136..ae04db2049d8e80ab85e8c4b1c6adeb0a950c8e9 100644 (file)
@@ -476,8 +476,14 @@ class PipelineRun(object):
         if self._flowcell_id is None:
           config_dir = os.path.join(self.pathname, 'Config')
           flowcell_id_path = os.path.join(config_dir, 'FlowcellId.xml')
-          flowcell_id_tree = ElementTree.parse(flowcell_id_path)
-          self._flowcell_id = flowcell_id_tree.findtext('Text')
+         if os.path.exists(flowcell_id_path):
+            flowcell_id_tree = ElementTree.parse(flowcell_id_path)
+            self._flowcell_id = flowcell_id_tree.findtext('Text')
+         else:
+           logging.warning(
+             "Unable to determine flowcell id as %s was not found" % (
+                flowcell_id_path))
+           self._flowcell_id = "unknown"
         return self._flowcell_id
     flowcell_id = property(_get_flowcell_id)