new module add in with lots of issues(part 2)

来源:互联网 发布:mac mini 加内存 编辑:程序博客网 时间:2024/05/07 09:55

上一篇中pkg_resources终于没问题了,但是发现keystone服务挂掉了:

 keystone endpoint-list
/usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
  'python-keystoneclient.', DeprecationWarning)
Authorization Failed: Unable to establish connection to http://xxx:5000/v2.0/tokens

尝试启动服务无法成功:

 systemctl start openstack-keystone.service

尝试重装一个keysstone覆盖现有的,发现可能存在问题,遇到问题无法甄别,还是重装RDO!

-------------------------

重装RDO之后,安装install guide一路继续配置,配nova,ironic,keystone。。。

现在要添加自己的模块,改变ironic-2014.2-py2.7.egg-info/中的 entry_points.txt    PKG-INFO  SOURCES.txt

分别子啊entry_points.txt的ironic.drivers下添加自己的module对应

在SOURCES.txt中添加自己新加入的class


运行:

pkg_resources.load_entry_point('ironic','ironic.drivers','new driver')

发现有些错误,自己看是因为有些包不匹配,打开自己的源码发现是import中有些包太新,2014.2版本中还没有这样的包,于是改成响应的老包

再次运行发现

AttributeError: 'module' object has no attribute 'passthru'

查看2014.2版本的源码,那个时候竟然连@base.passthru的语法糖也没有。。。

这个时候可以:

A,自己重新做一个包,使用新的包,可能会存在ironic中需要的oslo相关的包没有,因而报错,可能需要自己不断的修修补补,比较麻烦

B,整个RDO搭建出来的各个模块重新更新到较新的版本,太麻烦。。。

C,先用老的写法写自己的模块验证。。。工作量最小

@base.passthru的语法糖,转而使用:

def vendor_passthru(self, task, **kwargs):
            """Calls a valid vendor passthru method.
            :param task: a TaskManager instance containing the node to act on.
            :param kwargs: kwargs containing the vendor passthru method and its
            parameters.
            """
            method = kwargs['method']

            xxxx


然后好了,终于在pkg_resouces.load_entry_point中出现了自己的driver


0 0