equal
deleted
inserted
replaced
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) |