Changeset 4484


Ignore:
Timestamp:
24/11/08 10:04:23 (11 years ago)
Author:
cbyrom
Message:

Revert changes to myConfig code - this throws an exception when its get() method doesn't return a result - unlike other dicts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/ndgObject.py

    r4483 r4484  
    106106 
    107107        # set default return format - if not set, just return in original format 
    108         fmt = self.config.get('DISCOVERY','formatDefault') 
    109         if fmt: 
     108        fmt='' 
     109        if self.config.has_option('DISCOVERY','formatDefault'): 
     110            fmt = self.config.get('DISCOVERY','formatDefault') 
    110111            logging.info("Default discovery format set to: %s" %fmt) 
    111112             
     
    119120        # config file should have details on the service to use for the repository 
    120121        # - if not, default to 'unknown' 
    121         servicehost = self.config.get('NDG_B_SERVICE',self.repository) 
    122         if not servicehost: 
    123             servicehost = 'unknown' 
     122        servicehost = 'unknown' 
     123        if self.config.has_option('NDG_B_SERVICE',self.repository): 
     124                servicehost = self.config.get('NDG_B_SERVICE',self.repository) 
    124125             
    125126        # If this record is itself a discovery record, then we don't have much more to do 
Note: See TracChangeset for help on using the changeset viewer.