dhcp 提示could not load neutron.agent

错误日志如下:

N版存在问题,其它版本不知道

解决方法(代码问题):

/usr/lib/python2.7/site-packages/neutron/common/utils.py

 

在这个方法上(def load_class_by_alias_or_classname)面增加下面代码:

class _SilentDriverManager(driver.DriverManager):
    """The lamest of hacks to allow us to pass a kwarg to DriverManager parent.

    DriverManager doesn't accept the warn_on_missing_entrypoint param
    to pass to its parent on __init__ so we mirror the __init__ here and bypass
    the one in DriverManager in order to silence the warnings.
    TODO(kevinbenton): remove once Ia6f5f749fc2f73ca6091fa6d58506fddb058902a
    is released or we stop supporting loading by class path.
    """
    def __init__(self, namespace, name):
        p = super(driver.DriverManager, self)  # pylint: disable=bad-super-call
        p.__init__(
            namespace=namespace, names=[name],
            on_load_failure_callback=self._default_on_load_failure,
            warn_on_missing_entrypoint=False
        )

在修改下这个方法def load_class_by_alias_or_classname:

mgr = driver.DriverManager(namespace, name)
将上面代码改成下面 
mgr = _SilentDriverManager(namespace, name)

 

重启服务即可:

systemctl restart neutron-dhcp-agent.service  neutron-metadata-agent.service

posted @ 2017-06-22 13:58  MKY-门可意  阅读(269)  评论(0编辑  收藏  举报