From d28c780eda9e3727ec9610095c627406c404588a Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 13 May 2008 16:36:55 +0000 Subject: [PATCH] add additional debugging logging to retrieve_config and configure_pipeline to help figure out why it was failing. (which turned out to originally be because of user error) --- gaworkflow/pipeline/configure_run.py | 4 +++- gaworkflow/pipeline/retrieve_config.py | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gaworkflow/pipeline/configure_run.py b/gaworkflow/pipeline/configure_run.py index 272d1ae..e75d73a 100644 --- a/gaworkflow/pipeline/configure_run.py +++ b/gaworkflow/pipeline/configure_run.py @@ -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 diff --git a/gaworkflow/pipeline/retrieve_config.py b/gaworkflow/pipeline/retrieve_config.py index 6ffa7bb..72cff17 100644 --- a/gaworkflow/pipeline/retrieve_config.py +++ b/gaworkflow/pipeline/retrieve_config.py @@ -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,)) -- 2.30.2