Revision d509e6da snf-common/synnefo/settings/__init__.py

b/snf-common/synnefo/settings/__init__.py
57 57
        conffiles = [f for f in entries if os.path.isfile(f) and
58 58
                     f.endswith(".conf")]
59 59
    except Exception as e:
60
        print >>sys.stderr, "Failed to list *.conf files under %s" % \
61
                            SYNNEFO_SETTINGS_DIR
60
        print >> sys.stderr, "Failed to list *.conf files under %s" % \
61
                             SYNNEFO_SETTINGS_DIR
62 62
        raise SystemExit(1)
63 63
    conffiles.sort()
64 64
    for f in conffiles:
65 65
        try:
66 66
            execfile(os.path.abspath(f))
67 67
        except Exception as e:
68
            print >>sys.stderr, "Failed to read settings file: %s [%r]" % \
69
                                (os.path.abspath(f), e)
68
            print >> sys.stderr, "Failed to read settings file: %s [%r]" % \
69
                                 (os.path.abspath(f), e)
70 70
            raise SystemExit(1)
71

  
72

  
73
from os import environ
74
# The tracing code is enabled by an environmental variable and not a synnefo
75
# setting, on purpose, so that you can easily control whether it'll get loaded
76
# or not, based on context (eg enable it for gunicorn but not for eventd).
77
if environ.get('SYNNEFO_TRACE'):
78
    from synnefo.lib import trace
79
    trace.set_signal_trap()

Also available in: Unified diff