Skip to content

Commit

Permalink
remove backward-compatibility with Twisted-8.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Apr 12, 2012
1 parent c8f86e8 commit 7772348
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions master/buildbot/scripts/buildbot_tac.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ basedir = '.'
{% else -%}
basedir = {{ basedir|repr }}
{%- endif %}
{% if not no_logrotate -%}
rotateLength = {{ log_size|repr }}
maxRotatedFiles = {{ log_count|repr }}
{%- endif %}
configfile = {{ config|repr }}

# Default umask for server
Expand All @@ -24,19 +26,17 @@ if basedir == '.':
# directory; do not edit it.
application = service.Application('buildmaster')
{% if not no_logrotate -%}
try:
from twisted.python.logfile import LogFile
from twisted.python.log import ILogObserver, FileLogObserver
logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
maxRotatedFiles=maxRotatedFiles)
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
except ImportError:
# probably not yet twisted 8.2.0 and beyond, can't set log yet
pass
from twisted.python.logfile import LogFile
from twisted.python.log import ILogObserver, FileLogObserver
logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
maxRotatedFiles=maxRotatedFiles)
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
{%- endif %}

m = BuildMaster(basedir, configfile, umask)
m.setServiceParent(application)
{% if not no_logrotate -%}
m.log_rotation.rotateLength = rotateLength
m.log_rotation.maxRotatedFiles = maxRotatedFiles
{%- endif %}

0 comments on commit 7772348

Please sign in to comment.