Fix bug 1236: Retry if leader unit is not obtained 32/9832/4
authorDavid Garcia <david.garcia@canonical.com>
Thu, 15 Oct 2020 11:16:45 +0000 (13:16 +0200)
committerDavid Garcia <david.garcia@canonical.com>
Wed, 21 Oct 2020 11:28:23 +0000 (13:28 +0200)
commit59f520da90fb12b9d9871889dfbc5d57aa14c591
tree56c43333879f27690ea51ccf0d5aa4ef824c8c43
parent7077e2601a209a87f7fe397b35586e7701ca759a
Fix bug 1236: Retry if leader unit is not obtained

There a racing condition when N2VC tries to get the leader unit, but there
leader-elected hook has not been triggered. In that case, day-1 action might fail.

This commit solved this issue by retrying a couple of times.

Change-Id: If79cd243aa9ebdf8ed0e6235481eeb9fd2640612
Signed-off-by: David Garcia <david.garcia@canonical.com>
n2vc/libjuju.py
n2vc/tests/unit/test_libjuju.py