~ressu/bcfg2/debian

« back to all changes in this revision

Viewing changes to src/lib/Server/Core.py

  • Committer: Sami Haahtinen
  • Date: 2007-06-30 22:49:55 UTC
  • mfrom: (616.2.476)
  • Revision ID: ressu@ressukka.net-20070630224955-3nsy7ekzxha7h39x
import new upstream release 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
'''Bcfg2.Server.Core provides the runtime support for bcfg2 modules'''
2
 
__revision__ = '$Revision: 2614 $'
 
2
__revision__ = '$Revision: 3270 $'
3
3
 
4
4
from time import time
5
5
from Bcfg2.Server.Plugin import PluginInitError, PluginExecutionError
103
103
    '''This class provides an event analogous to python-fam events based on gamin sources'''
104
104
    def __init__(self, request_id, filename, code):
105
105
        action_map = {GAMCreated: 'created', GAMExists: 'exists', GAMChanged: 'changed',
106
 
                      GAMDeleted: 'deleted', GAMEndExist: 'endExist'}
 
106
                      GAMDeleted: 'deleted', GAMEndExist: 'endExist', GAMMoved: 'moved'}
107
107
        self.requestID = request_id
108
108
        self.filename = filename
109
109
        if action_map.has_key(code):
185
185
        return count
186
186
        
187
187
try:
188
 
    from gamin import WatchMonitor, GAMCreated, GAMExists, GAMEndExist, GAMChanged, GAMDeleted
 
188
    from gamin import WatchMonitor, GAMCreated, GAMExists, GAMEndExist, GAMChanged, GAMDeleted, GAMMoved
189
189
    monitor = GaminFam
190
190
except ImportError:
191
191
    # fall back to _fam