RESTCONF, or NETCONF, may not always be available. Break out and
refactor transport detection/reachability.
NOTE: The shared code paths between wait.py and util.py:wait_boot()
have been refactored as well to reduce code duplication.
Issue #597
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
If a container has not yet stopped/started we may for proto RESTCONF get
"invalid URI" result back for some container actions. With this change
we allow the action to be retried up to three times before passing on
the error.
In tests on Qemu (x86_64) this happens very rarely and need at most one
retry before succeeding. Verified by iterating the same basic test over
night (9000+ iterations).
Fixes#558
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>