Skip to content

Commit

Permalink
Add retry on RuntimeError while connecting to api server
Browse files Browse the repository at this point in the history
While connecting to API server, the library could raise RuntimeError if
authentication fails. During system init, it is possible that keystone server is
not yet up. We should retry on such failure.

Change-Id: I2cc84c1d6fbd3e78fb6cb42d3c21944b54c0061b
Closes-Bug: 1477907
(cherry picked from commit 44fe58f7857fb33020412e9b0bd832f505eb3978)
(cherry picked from commit e6112b9)
  • Loading branch information
Sachin Bansal authored and Hampapur Ajay committed Oct 2, 2015
1 parent f25df2c commit 05c2f31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config/schema-transformer/to_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3940,7 +3940,8 @@ def connection_state_update(status, message=None):
# Update connection info
connection_state_update(ConnectionStatus.DOWN, str(e))
time.sleep(3)
except ResourceExhaustionError: # haproxy throws 503
except (RuntimeError, ResourceExhaustionError):
# auth failure or haproxy throws 503
time.sleep(3)

global transformer
Expand Down

0 comments on commit 05c2f31

Please sign in to comment.