Merge "Fix expected status code in Ironic heartbeat"

This commit is contained in:
Jenkins
2014-04-24 22:41:52 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ class APIClient(object):
except Exception as e:
raise errors.HeartbeatError(str(e))
if response.status_code != requests.codes.NO_CONTENT:
if response.status_code != requests.codes.ACCEPTED:
msg = 'Invalid status code: {0}'.format(response.status_code)
raise errors.HeartbeatError(msg)

View File

@@ -55,7 +55,7 @@ class TestBaseIronicPythonAgent(test_base.BaseTestCase):
def test_successful_heartbeat(self):
expected_heartbeat_before = time.time() + 120
response = FakeResponse(status_code=204, headers={
response = FakeResponse(status_code=202, headers={
'Heartbeat-Before': expected_heartbeat_before,
})
@@ -95,7 +95,7 @@ class TestBaseIronicPythonAgent(test_base.BaseTestCase):
advertise_address=('192.0.2.1', '9999'))
def test_heartbeat_missing_heartbeat_before_header(self):
response = FakeResponse(status_code=204)
response = FakeResponse(status_code=202)
self.api_client.session.request = mock.Mock()
self.api_client.session.request.return_value = response
@@ -105,7 +105,7 @@ class TestBaseIronicPythonAgent(test_base.BaseTestCase):
advertise_address=('192.0.2.1', '9999'))
def test_heartbeat_invalid_heartbeat_before_header(self):
response = FakeResponse(status_code=204, headers={
response = FakeResponse(status_code=202, headers={
'Heartbeat-Before': 'tomorrow',
})
self.api_client.session.request = mock.Mock()