我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用charmhelpers.core.hookenv.DEBUG。
def __call__(self, manager, service_name, event_name): pre_checksum = '' if self.on_change_action and os.path.isfile(self.target): pre_checksum = host.file_hash(self.target) service = manager.get_service(service_name) context = {'ctx': {}} for ctx in service.get('required_data', []): context.update(ctx) context['ctx'].update(ctx) result = templating.render(self.source, self.target, context, self.owner, self.group, self.perms, template_loader=self.template_loader) if self.on_change_action: if pre_checksum == host.file_hash(self.target): hookenv.log( 'No change detected: {}'.format(self.target), hookenv.DEBUG) else: self.on_change_action() return result # Convenience aliases for templates