← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1414522] [NEW] _get_ironic_client should catch NotImplement exception and handle it

 

Public bug reported:

When call os-baremetal-nodes API at the environment in which ironic is not enable,
internal error occurs like below.

Traceback (most recent call last):
  File "tempest/api/compute/admin/test_baremetal.py", line 34, in test_list_baremetal_nodes
    baremetal_nodes = self.client.list_baremetal_nodes()
  File "tempest/services/compute/json/baremetal_client.py", line 33, in list_baremetal_nodes
    resp, body = self.get(url)
  File "/usr/local/lib/python2.7/dist-packages/tempest_lib/common/rest_client.py", line 171, in get
    return self.request('GET', url, extra_headers, headers)
  File "tempest/common/service_client.py", line 83, in request
    raise exceptions.ServerFault(ex)
ServerFault: Got server fault
Details: Got server fault
Details: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.AttributeError'>

http://logs.openstack.org/25/149125/1/check/check-tempest-dsvm-
nova-v21-full/86687c5/logs/testr_results.html.gz

nova-api's error log is below.

2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions Traceback (most recent call last):
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions   File "/opt/stack/new/nova/nova/api/openstack/extensions.py", line 451, in wrapped
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions     return f(*args, **kwargs)
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions   File "/opt/stack/new/nova/nova/api/openstack/compute/plugins/v3/baremetal_nodes.py", line 97, in ind
ex
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions     icli = _get_ironic_client()
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions   File "/opt/stack/new/nova/nova/api/openstack/compute/plugins/v3/baremetal_nodes.py", line 69, in _get_ironic_client
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions     icli = ironic_client.get_client(CONF.ironic.api_version, **kwargs)
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions AttributeError: 'NoneType' object has no attribute 'get_client'
2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions
2015-01-22 03:12:47.895 INFO nova.api.openstack.wsgi [req-dc985e8a-edc5-4d34-9424-50c424e5a55c BaremetalAdminTestJSON-1435782774 BaremetalAdminTestJSON-219186341] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.AttributeError'>

We should catch NotImplement exception and handle it.

** Affects: nova
     Importance: Undecided
     Assignee: Yuiko Takada (takada-yuiko)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Yuiko Takada (takada-yuiko)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1414522

Title:
  _get_ironic_client should catch NotImplement exception and handle it

Status in OpenStack Compute (Nova):
  New

Bug description:
  When call os-baremetal-nodes API at the environment in which ironic is not enable,
  internal error occurs like below.

  Traceback (most recent call last):
    File "tempest/api/compute/admin/test_baremetal.py", line 34, in test_list_baremetal_nodes
      baremetal_nodes = self.client.list_baremetal_nodes()
    File "tempest/services/compute/json/baremetal_client.py", line 33, in list_baremetal_nodes
      resp, body = self.get(url)
    File "/usr/local/lib/python2.7/dist-packages/tempest_lib/common/rest_client.py", line 171, in get
      return self.request('GET', url, extra_headers, headers)
    File "tempest/common/service_client.py", line 83, in request
      raise exceptions.ServerFault(ex)
  ServerFault: Got server fault
  Details: Got server fault
  Details: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <type 'exceptions.AttributeError'>

  http://logs.openstack.org/25/149125/1/check/check-tempest-dsvm-
  nova-v21-full/86687c5/logs/testr_results.html.gz

  nova-api's error log is below.

  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions Traceback (most recent call last):
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions   File "/opt/stack/new/nova/nova/api/openstack/extensions.py", line 451, in wrapped
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions     return f(*args, **kwargs)
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions   File "/opt/stack/new/nova/nova/api/openstack/compute/plugins/v3/baremetal_nodes.py", line 97, in ind
  ex
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions     icli = _get_ironic_client()
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions   File "/opt/stack/new/nova/nova/api/openstack/compute/plugins/v3/baremetal_nodes.py", line 69, in _get_ironic_client
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions     icli = ironic_client.get_client(CONF.ironic.api_version, **kwargs)
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions AttributeError: 'NoneType' object has no attribute 'get_client'
  2015-01-22 03:12:47.894 18727 TRACE nova.api.openstack.extensions
  2015-01-22 03:12:47.895 INFO nova.api.openstack.wsgi [req-dc985e8a-edc5-4d34-9424-50c424e5a55c BaremetalAdminTestJSON-1435782774 BaremetalAdminTestJSON-219186341] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <type 'exceptions.AttributeError'>

  We should catch NotImplement exception and handle it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1414522/+subscriptions


Follow ups

References