Skip to content

Commit

Permalink
Replace backoff looping call with oslo_service provided version
Browse files Browse the repository at this point in the history
The code that comprises the backoff looping call moved to
oslo.service in 0.10.0 and IPA can use that version so remove
the local backoff code and just prefer the oslo.service maintained
and supported version instead.

Change-Id: Ifec3490f9e5c68859deff4a951dcdf59caa7ca3a
  • Loading branch information
Joshua Harlow committed Feb 4, 2016
1 parent 3ce3b16 commit df701c9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 218 deletions.
113 changes: 0 additions & 113 deletions ironic_python_agent/backoff.py

This file was deleted.

5 changes: 2 additions & 3 deletions ironic_python_agent/ironic_api_client.py
Expand Up @@ -18,7 +18,6 @@
from oslo_service import loopingcall
import requests

from ironic_python_agent import backoff
from ironic_python_agent import encoding
from ironic_python_agent import errors

Expand Down Expand Up @@ -80,14 +79,14 @@ def heartbeat(self, uuid, advertise_address):

def lookup_node(self, hardware_info, timeout, starting_interval,
node_uuid=None):
timer = backoff.BackOffLoopingCall(
timer = loopingcall.BackOffLoopingCall(
self._do_lookup,
hardware_info=hardware_info,
node_uuid=node_uuid)
try:
node_content = timer.start(starting_interval=starting_interval,
timeout=timeout).wait()
except backoff.LoopingCallTimeOut:
except loopingcall.LoopingCallTimeOut:
raise errors.LookupNodeError('Could not look up node info. Check '
'logs for details.')
return node_content
Expand Down
100 changes: 0 additions & 100 deletions ironic_python_agent/tests/unit/test_backoff.py

This file was deleted.

3 changes: 1 addition & 2 deletions ironic_python_agent/tests/unit/test_ironic_api_client.py
Expand Up @@ -18,7 +18,6 @@
from oslo_service import loopingcall
from oslotest import base as test_base

from ironic_python_agent import backoff
from ironic_python_agent import errors
from ironic_python_agent import hardware
from ironic_python_agent import ironic_api_client
Expand Down Expand Up @@ -111,7 +110,7 @@ def test_lookup_node(self, lookup_mock, sleep_mock):
@mock.patch('eventlet.greenthread.sleep')
@mock.patch('ironic_python_agent.ironic_api_client.APIClient._do_lookup')
def test_lookup_timeout(self, lookup_mock, sleep_mock):
lookup_mock.side_effect = backoff.LoopingCallTimeOut()
lookup_mock.side_effect = loopingcall.LoopingCallTimeOut()
self.assertRaises(errors.LookupNodeError,
self.api_client.lookup_node,
hardware_info=self.hardware_info,
Expand Down

0 comments on commit df701c9

Please sign in to comment.