Changeset 14157 for trunk


Ignore:
Timestamp:
04/27/12 16:15:12 (12 years ago)
Author:
ramonb
Message:

sara_cmt/sara_cmt/settings.py:

  • catch an other ConfigParser? exception
  • some virtualenv-anized changes
  • see #9
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sara_cmt/sara_cmt/settings.py

    r14156 r14157  
    11
    2 import os, sys, ConfigParser
     2import os, sys, ConfigParser, site
    33
    44from socket import gethostbyname_ex
    55
     6configfile = '%s/etc/cmt/cmt.conf' % site.sys.prefix
     7
    68config = ConfigParser.RawConfigParser()
    7 config.read('/etc/cmt/cmt.conf')
     9config.read( configfile )
    810
    911try:
     
    1416        DATABASE_NAME = config.get('database', 'NAME')
    1517
    16 except ConfigParser.NoOptionError, details:
     18except (ConfigParser.NoOptionError, ConfigParser.NoSectionError), details:
    1719
    1820        print 'Config file error: %s' %str(details)
Note: See TracChangeset for help on using the changeset viewer.