add additional debugging logging to retrieve_config and configure_pipeline
authorDiane Trout <diane@caltech.edu>
Tue, 13 May 2008 16:36:55 +0000 (16:36 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 13 May 2008 16:36:55 +0000 (16:36 +0000)
to help figure out why it was failing. (which turned out to originally be
because of user error)

gaworkflow/pipeline/configure_run.py
gaworkflow/pipeline/retrieve_config.py

index 272d1ae3431ecff959ec05ec85de8fc7d8d32a0f..e75d73ad50c88ea4fe55d8cdb684e500e29119dd 100644 (file)
@@ -392,11 +392,13 @@ def retrieve_config(conf_info, flowcell, cfg_filepath, genome_dir):
   genome_dict = getAvailableGenomes(genome_dir)
   mapper_dict = constructMapperDict(genome_dict)
 
+  logging.debug(data)
+
   f = open(cfg_filepath, 'w')
   f.write(data % (mapper_dict))
   f.close()
   
-  return True  
+  return True
   
 
 
index 6ffa7bbfb2d330a37e60450b9a56909cc515c17a..72cff17542e10a941d07e211973227edb90d876c 100644 (file)
@@ -3,9 +3,10 @@
 from optparse import OptionParser, IndentedHelpFormatter
 from ConfigParser import SafeConfigParser
 
+import logging
 import os
 import sys
-import urllib
+import urllib2
 
 CONFIG_SYSTEM = '/etc/ga_frontend/ga_frontend.conf'
 CONFIG_USER = os.path.expanduser('~/.ga_frontend.conf')
@@ -144,7 +145,15 @@ def saveConfigFile(flowcell, base_host_url, output_filepath):
   
   f = open(output_filepath, 'w')
   #try:
-  web = urllib.urlopen(url)
+  try:
+    web = urllib2.urlopen(url)
+  except urllib2.URLError, e:
+    errmsg = 'URLError: %d' % (e.code,)
+    logging.error(errmsg)
+    logging.error('opened %s' % (url,))
+    logging.error('%s' % ( e.read(),))
+    raise IOError(errmsg)
+
   #except IOError, msg:
   #  if str(msg).find("Connection refused") >= 0:
   #    print 'Error: Connection refused for: %s' % (url)
@@ -171,6 +180,6 @@ def saveConfigFile(flowcell, base_host_url, output_filepath):
   f.write(data)
   web.close()
   f.close()
-  print 'Wrote config file to %s' % (output_filepath)
+  logging.info('Wrote config file to %s' % (output_filepath,))