Merge "Fix IPA for stable/mitaka with noauth mode"

This commit is contained in:
Jenkins 2016-09-01 09:19:52 +00:00 committed by Gerrit Code Review
commit c4c7115d4f
2 changed files with 5 additions and 1 deletions

View File

@ -123,7 +123,8 @@ class APIClient(object):
headers=self.ramdisk_api_headers, headers=self.ramdisk_api_headers,
params=params) params=params)
if response.status_code in (requests.codes.NOT_FOUND, if response.status_code in (requests.codes.NOT_FOUND,
requests.codes.UNAUTHORIZED): requests.codes.UNAUTHORIZED,
requests.codes.NOT_ACCEPTABLE):
# Assume that new API is not available and retry # Assume that new API is not available and retry
LOG.warning('New API is not available, falling back to old ' LOG.warning('New API is not available, falling back to old '
'agent vendor passthru') 'agent vendor passthru')

View File

@ -353,3 +353,6 @@ class TestBaseIronicPythonAgent(test_base.BaseTestCase):
def test_do_lookup_fallback_unauthorized(self): def test_do_lookup_fallback_unauthorized(self):
self._test_do_lookup_fallback(error_code=requests.codes.UNAUTHORIZED) self._test_do_lookup_fallback(error_code=requests.codes.UNAUTHORIZED)
def test_do_lookup_fallback_not_acceptable(self):
self._test_do_lookup_fallback(error_code=requests.codes.NOT_ACCEPTABLE)