Changeset 6132


Ignore:
Timestamp:
15/12/09 11:26:06 (10 years ago)
Author:
sdonegan
Message:

fixing bugs in config file handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/abstractdocumentingester.py

    r6131 r6132  
    221221 
    222222                #note changed to production buildout path 
    223                 datacentre_config_filename = '/home/badc/buildouts/oai_document_ingester/ingestAutomation-upgrade/OAIBatch/datacentre_config/' + datacentre + "_config.properties" 
    224                 logging.info("Retrieving data from datacentre config file, " + datacentre_config_filename) 
     223                #self._datacentre_config_filename = '/home/badc/buildouts/oai_document_ingester/ingestAutomation-upgrade/OAIBatch/datacentre_config/' + datacentre + "_config.properties" 
    225224                 
    226225                #fed up with this rubbish causing problems - use a normal file opener. 
    227226                #file = pkg_resources.resource_string('OAIBatch', datacentre_config_filename) 
     227                 
     228                self._datacentre_config_filename = self._code_dir + 'datacentre_config/' + datacentre + "_config.properties" 
     229                logging.info("Retrieving data from datacentre config file, " + self._datacentre_config_filename) 
     230                 
     231                # Check this file exists; if not, assume an invalid datacentre has been specified 
     232                if not os.path.isfile(self._datacentre_config_filename): 
     233                    sys.exit("ERROR: Could not find the config file; either this doesn't exist or the datacentre " \ 
     234                        "specified (%s) is invalid\n" %datacentre) 
     235                     
    228236                 
    229237                datacentre_config_file = open(self._datacentre_config_filename, "r") 
Note: See TracChangeset for help on using the changeset viewer.