Files
python-ironicclient/ironicclient
Mark Goddard 0e9bf337f1 Fix AttributeError in negotiate_version
Seen in kolla-ansible CI, if ironic inspector starts up before ironic
API is properly up, we see the following error:

The PXE filter DnsmasqFilter, state=initialized encountered an
exception: StrictVersion instance has no attribute 'version'; resetting
the filter: AttributeError: StrictVersion instance has no attribute
'version'

Example: http://paste.openstack.org/show/756342/

The usual cause of this error is when StrictVersion is initialised with
a version of None. This suggests to me that max_ver is None.

This leads to an exception being raised that circumvents the client's
retry mechanisms.

In the particular case of kolla-ansible CI, Ironic API is behind a load
balancer, and all backends are down resulting in a 503. The lack of a
retry caused ironic inspector to fail on startup.

This patch catches the case where we get a 4xx or 5xx return code when
checking the version, and raises an error that works with the client's
retry mechanisms.

Change-Id: Ib62ca3ee4626084e5e9b90e93e4fa97938023457
Story: 2006393
Task: 36266
2019-11-22 17:43:38 +00:00
..
2019-06-06 08:52:49 +05:30
2019-08-21 15:10:17 +02:00