Re-use API client for Heartbeat operations

Re-initialization of the API client causes the identification
of an older ironic API to be forgotten.

As such, we need to re-use the API client from the initial lookup
for the heartbeat.

Tested with current master branch and stable/mitaka ipa
in noauth mode, and was able to deploy without any issues.

Closes-Bug: #1616461
Change-Id: I3ae1e2ce83f614b5b936a3cbb1b9587c6c55a89a
This commit is contained in:
Julia Kreger 2016-08-24 13:16:32 -04:00
parent e3c7f7c7cc
commit 95f31be108

@ -88,8 +88,7 @@ class IronicPythonAgentHeartbeater(threading.Thread):
"""
super(IronicPythonAgentHeartbeater, self).__init__()
self.agent = agent
self.api = ironic_api_client.APIClient(agent.api_url,
agent.driver_name)
self.api = agent.api_client
self.error_delay = self.initial_delay
self.reader = None
self.writer = None