0

我写了一个自定义插件,它有不同的 yum viz 钩子。config_hook、postreposetup_hook、exclude_hook、preresolve_hook 等...问题是,有时在执行 yum 命令时,不会在新机器上调用 postreposetup 和 exclude 挂钩。我还在每个钩子中编写了另一个带有简单打印语句的插件,并且该插件中的每个钩子都被调用。我无法弄清楚问题所在。

下面是一个正在工作的简单插件,不幸的是我不能在这里分享其他插件的代码,但它连接到 postreposetup_hook 中的服务器,并且 exclude_hook 执行包排除。任何指针都会非常有帮助。

import yum
from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE

requires_api_version='2.3'
plugin_type=(TYPE_CORE)
def config_hook(conduit):
    print 'In config'

def init_hook(conduit):
    print 'In init'
def prereposetup_hook(conduit):
    print 'In prereposetup'
def postreposetup_hook(conduit):
    print 'In postreposetup'
def exclude_hook(conduit):
    print 'In exclude'
def preresolve_hook(conduit):
    print 'In preresolve'
def postresolve_hook(conduit):
    print 'In postreposetup'
4

0 回答 0