fix the powervc nova driver AttributeError

Bug #1363825 reported by Terry Yao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powervc-driver
Fix Committed
Undecided
Unassigned

Bug Description

In recently build, it's reporting error:
2014-08-31 21:43:07.514 7558 ERROR oslo.messaging.rpc.dispatcher [req-78a7be46-91fc-4e0e-a26c-ccd3ec227e0a ] Exception during message handling: 'ServerManager' object has no attribute 'Server'
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/exception.py", line 88, in wrapped
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher payload)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/exception.py", line 71, in wrapped
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return f(self, context, *args, **kw)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 300, in decorated_function
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher pass
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 286, in decorated_function
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 350, in decorated_function
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 328, in decorated_function
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher kwargs['instance'], e, sys.exc_info())
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 316, in decorated_function
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2454, in terminate_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher do_terminate_instance(instance, bdms)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/lockutils.py", line 325, in inner
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return f(*args, **kwargs)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2452, in do_terminate_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher self._set_instance_error_state(context, instance)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2442, in do_terminate_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher self._delete_instance(context, instance, bdms, quotas)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/hooks.py", line 131, in inner
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher rv = f(*args, **kwargs)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2411, in _delete_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher quotas.rollback()
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2388, in _delete_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher self._shutdown_instance(context, instance, bdms)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2318, in _shutdown_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher requested_networks)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 82, in __exit__
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 2307, in _shutdown_instance
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher block_device_info)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/opt/ibm/openstack/powervc-driver/powervc/nova/driver/virt/powervc/driver.py", line 339, in destroy
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher return self._service.destroy(instance)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/opt/ibm/openstack/powervc-driver/powervc/nova/driver/virt/powervc/service.py", line 787, in destroy
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher server_instance = self._get_server(instance)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher File "/opt/ibm/openstack/powervc-driver/powervc/nova/driver/virt/powervc/service.py", line 536, in _get_server
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher server = self._servers.Server(self._manager, instance)
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher AttributeError: 'ServerManager' object has no attribute 'Server'
2014-08-31 21:43:07.514 7558 TRACE oslo.messaging.rpc.dispatcher

from the code, it's using:
server = self._servers.Server(self._manager, instance)

and such self._server is very strange, it's referring a module from debugger:
(Pdb) print self._client
<powervc.common.client.delegate.CompositeDelegator object at 0x46df790>
(Pdb) print self._client.servers
<module 'novaclient.v1_1.servers' from '/usr/lib/python2.6/site-packages/novaclient/v1_1/servers.pyc'>

but now it's not referring such module, but the real ServerManager in nova client:
(Pdb) print self._client
<powervc.common.client.delegate.CompositeDelegator object at 0x3acc8d0>
(Pdb) print self._client.servers
<novaclient.v1_1.servers.ServerManager object at 0x3c5ad50>

I can not understand we are referring a module instead of import such stuff from nova client package.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to powervc-driver (master)

Reviewed: https://review.openstack.org/118101
Committed: https://git.openstack.org/cgit/stackforge/powervc-driver/commit/?id=a2971dff90ff1ebf604afc12ce1836e1eed9b4ca
Submitter: Jenkins
Branch: master

commit a2971dff90ff1ebf604afc12ce1836e1eed9b4ca
Author: Terry Yao <email address hidden>
Date: Mon Sep 1 15:18:49 2014 +0800

    import novaclient.v1_1.servers module direclty in nova driver

    Actually, our patched nova client only support novaclient.v1_1, we need
    to import novaclient.v1_1.servers in nova driver instead of using a
    module from the patched client and that patch has been removed as
    breaking the novaclient UT code.

    Closes-Bug: #1363825
    Change-Id: I66abd40952974e0eb422b95d1c6087c589957d93

Changed in powervc-driver:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.