Changeset 6824


Ignore:
Timestamp:
Apr 17, 2009, 1:44:22 PM (15 years ago)
Author:
rwilson
Message:

Changes into error handling getting files over the 'net.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy_anuga_validation/automated_validation_tests/patong_beach_validation/validate_patong.py

    r6808 r6824  
    5555
    5656    These are expected to be *.tgz files/directories.
     57    Return True if all went well, else False.
    5758    '''
    5859   
     
    8889                                local_digest, auth=auth)
    8990            if auth == False:
     91                log.info("Couldn't fetch file: %s" % digest_url)
    9092                return False
    9193            log.info('Fetching remote file %s' % object_url)
     
    123125
    124126    # create local data directory if required
     127    log.debug('Creating local directory: %s' % Local_Data_Directory)
    125128    if not os.path.exists(Local_Data_Directory):
    126129        os.mkdir(Local_Data_Directory)
    127130
    128131    # clean out remote data copy directory
     132    log.debug('Cleaning remote directory: %s' % Remote_Data_Directory)
    129133    shutil.rmtree(Remote_Data_Directory, ignore_errors=True)
    130134    os.mkdir(Remote_Data_Directory)
     
    133137    auth = None
    134138    for data_object in Local_Data_Objects:
     139        log.debug('Trying to update: %s' % data_object)
    135140        auth = update_object(data_object, auth)
    136141        if auth == False:
     142            log.debug('Failed fetching %s, returning False' % data_object)
    137143            return False
    138144
     
    155161    '''
    156162
    157     log.critical('Checking if you have the required files ...')
     163    log.critical('Checking if you have the required files to run locally ...')
    158164
    159165    have_files = True
     
    180186    # now untar file/directory objects
    181187    for obj in Local_Data_Objects:
    182         log.debug('Untarring %s in directory %s'
    183                   % (obj_path, Local_Data_Directory))
     188        log.info('Untarring %s in directory %s'
     189                 % (obj_path, Local_Data_Directory))
    184190        untar_file(obj_path, target_dir=Local_Data_Directory)
    185191
     
    298304# make sure local data is up to date
    299305if not update_local_data():
     306    log.info("Can't update local files over the internet (for some reason).")
    300307    if not can_we_run():
    301308        log.critical('')
     
    316323
    317324# clean up
    318 teardown()
     325#teardown()
Note: See TracChangeset for help on using the changeset viewer.