python cinderclient services attribute error

asked 2015-12-20 07:36:11 -0600

tzure gravatar image

Hi I'm using this python cinderClient:
http://docs.openstack.org/developer/p...
I'm running this on the controller node. So, everything works fine, except for one command.

cinder.services.list()

Each time I run this command, I get an attribute error. this is the error (using Ipython so you can see stacktrace)

    AttributeError                            Traceback (most recent call last)
<ipython-input-7-311d45a36f72> in <module>()
----> 1 cinder.services.list()

/usr/lib/python2.7/dist-packages/IPython/core/displayhook.pyc in __call__(self, result)
    245             self.start_displayhook()
    246             self.write_output_prompt()
--> 247             format_dict, md_dict = self.compute_format_data(result)
    248             self.write_format_data(format_dict, md_dict)
    249             self.update_user_ns(result)

/usr/lib/python2.7/dist-packages/IPython/core/displayhook.pyc in compute_format_data(self, result)
    155 
    156         
--> 157         return self.shell.display_formatter.format(result)
    158 
    159     def write_format_data(self, format_dict, md_dict=None):

/usr/lib/python2.7/dist-packages/IPython/core/formatters.pyc in format(self, obj, include, exclude)
    150             md = None
    151             try:
--> 152                 data = formatter(obj)
    153             except:
    154                 # FIXME: log the exception

/usr/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj)
    479                 type_pprinters=self.type_printers,
    480                 deferred_pprinters=self.deferred_printers)
--> 481             printer.pretty(obj)
    482             printer.flush()
    483             return stream.getvalue()

/usr/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in pretty(self, obj)
    345                 if cls in self.type_pprinters:
    346                     # printer registered in self.type_pprinters
--> 347                     return self.type_pprinters[cls](obj, self, cycle)
    348                 else:
    349                     # deferred printer

/usr/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in inner(obj, p, cycle)
    529                 p.text(',')
    530                 p.breakable()
--> 531             p.pretty(x)
    532         if len(obj) == 1 and type(obj) is tuple:
    533             # Special case for 1-item tuples.

/usr/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in pretty(self, obj)
    360                             if callable(meth):
    361                                 return meth(obj, self, cycle)
--> 362             return _default_pprint(obj, self, cycle)
    363         finally:
    364             self.end_group()

/usr/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
    480     if getattr(klass, '__repr__', None) not in _baseclass_reprs:
    481         # A user-provided repr.
--> 482         p.text(repr(obj))
    483         return
    484     p.begin_group(1, '<')

/usr/lib/python2.7/dist-packages/cinderclient/v1/services.pyc in __repr__(self)
     24     def __repr__(self):
     25         pdb.set_trace()
---> 26         return "<Service: %s>" % self.service
     27 
     28 

/usr/lib/python2.7/dist-packages/cinderclient/openstack/common/apiclient/base.pyc in __getattr__(self, k)
    461                 return self.__getattr__(k)
    462 
--> 463             raise AttributeError(k)
    464         else:
    465             return self.__dict__[k]

This means that the field "service" of the class "Service" was never initialized.
Was this never implemented? or is there some other bug?

Please note that the api command "cinder service-volume" does work. how can this work, but not the python cinderclient?

edit retag flag offensive close merge delete