当前位置: 首页>>代码示例>>Python>>正文


Python CfgGenerator.handle_event方法代码示例

本文整理汇总了Python中Bcfg2.Server.Plugins.Cfg.CfgGenerator.handle_event方法的典型用法代码示例。如果您正苦于以下问题:Python CfgGenerator.handle_event方法的具体用法?Python CfgGenerator.handle_event怎么用?Python CfgGenerator.handle_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bcfg2.Server.Plugins.Cfg.CfgGenerator的用法示例。


在下文中一共展示了CfgGenerator.handle_event方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     try:
         self.template = self.loader.load(self.name, cls=NewTextTemplate,
                                          encoding=self.encoding)
     except:
         raise PluginExecutionError("Failed to load template: %s" %
                                    sys.exc_info()[1])
开发者ID:PhilMiller,项目名称:bcfg2,代码行数:10,代码来源:CfgGenshiGenerator.py

示例2: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     try:
         self.template = \
             self.environment.get_template(self.name)
     except:
         raise PluginExecutionError("Failed to load template: %s" %
                                    sys.exc_info()[1])
开发者ID:Ank2015,项目名称:bcfg2,代码行数:10,代码来源:CfgJinja2Generator.py

示例3: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     if self.data is None:
         return
     # todo: let the user specify a passphrase by name
     try:
         self.data = bruteforce_decrypt(self.data)
     except EVPError:
         raise PluginExecutionError("Failed to decrypt %s" % self.name)
开发者ID:danfoster,项目名称:bcfg2,代码行数:11,代码来源:CfgEncryptedGenerator.py

示例4: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     if self.data is None:
         return
     # todo: let the user specify a passphrase by name
     try:
         self.data = bruteforce_decrypt(self.data, setup=SETUP,
                                        algorithm=get_algorithm(SETUP))
     except EVPError:
         msg = "Failed to decrypt %s" % self.name
         LOGGER.error(msg)
         raise PluginExecutionError(msg)
开发者ID:psteinbachs,项目名称:bcfg2,代码行数:14,代码来源:CfgEncryptedGenerator.py

示例5: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     if event.code2str() == 'deleted':
         return
     CfgGenerator.handle_event(self, event)
     try:
         self.template = self.loader.load(self.name, cls=NewTextTemplate,
                                          encoding=self.encoding)
     except Exception:
         msg = "Cfg: Could not load template %s: %s" % (self.name,
                                                        sys.exc_info()[1])
         logger.error(msg)
         raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
开发者ID:stpierre,项目名称:bcfg2,代码行数:14,代码来源:CfgGenshiGenerator.py

示例6: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     if self.data is None:
         return
     try:
         self.template = self.loader.load(self.name, cls=NewTextTemplate,
                                          encoding=self.encoding)
     except:
         msg = "Cfg: Could not load template %s: %s" % (self.name,
                                                        sys.exc_info()[1])
         LOGGER.error(msg)
         raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
开发者ID:psteinbachs,项目名称:bcfg2,代码行数:14,代码来源:CfgGenshiGenerator.py

示例7: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     if self.data is None:
         return
     # todo: let the user specify a passphrase by name
     try:
         self.data = bruteforce_decrypt(self.data)
     except EVPError:
         msg = "Cfg: Failed to decrypt %s" % self.name
         if Bcfg2.Options.setup.lax_decryption:
             self.logger.debug(msg)
         else:
             raise PluginExecutionError(msg)
开发者ID:nathanolla,项目名称:bcfg2,代码行数:15,代码来源:CfgEncryptedGenerator.py

示例8: handle_event

# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import handle_event [as 别名]
 def handle_event(self, event):
     CfgGenerator.handle_event(self, event)
     StructFile.HandleEvent(self, event)
     self.cache = dict()
开发者ID:danfoster,项目名称:bcfg2,代码行数:6,代码来源:CfgAuthorizedKeysGenerator.py


注:本文中的Bcfg2.Server.Plugins.Cfg.CfgGenerator.handle_event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。