hooks/syncsources.py
changeset 7049 f2ae6202754c
parent 7024 f4e798cf29b4
child 7399 972ed1843bd8
child 7525 1f6839019e6a
equal deleted inserted replaced
7048:453c7bbae3ff 7049:f2ae6202754c
    87 class SourceHostConfigUpdatedHook(SourceHook):
    87 class SourceHostConfigUpdatedHook(SourceHook):
    88     __regid__ = 'cw.sources.hostconfigupdate'
    88     __regid__ = 'cw.sources.hostconfigupdate'
    89     __select__ = SourceHook.__select__ & is_instance('CWSourceHostConfig')
    89     __select__ = SourceHook.__select__ & is_instance('CWSourceHostConfig')
    90     events = ('after_add_entity', 'after_update_entity', 'before_delete_entity',)
    90     events = ('after_add_entity', 'after_update_entity', 'before_delete_entity',)
    91     def __call__(self):
    91     def __call__(self):
    92         if self.entity.match_host(gethostname()):
    92         if self.entity.match(gethostname()):
    93             if self.event == 'after_update_entity' and \
    93             if self.event == 'after_update_entity' and \
    94                    not 'config' in self.entity.cw_edited:
    94                    not 'config' in self.entity.cw_edited:
    95                 return
    95                 return
    96             try:
    96             try:
    97                 SourceUpdatedOp.get_instance(self._cw).add_data(self.entity.cwsource)
    97                 SourceUpdatedOp.get_instance(self._cw).add_data(self.entity.cwsource)