Introduce a wrapper for hostname resolving
Currently a few of the LU's CheckPrereq use utils.HostInfo which raises a resolver error in case of failure. This is an exception from the standard that CheckPrereq should raise an OpPrereqError if the error is in the 'pre' phase (so that it can be retried). This patch adds a new error code (resolver_error) and a wrapper over utils.HostInfo that just converts the ResolverError into OpPrereqError(…, errors.ECODE_RESOLVER). It then uses this wrapper in cmdlib, bootstrap and some scripts. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
Showing
- lib/bootstrap.py 2 additions, 2 deletionslib/bootstrap.py
- lib/cmdlib.py 4 additions, 4 deletionslib/cmdlib.py
- lib/errors.py 2 additions, 0 deletionslib/errors.py
- lib/utils.py 10 additions, 0 deletionslib/utils.py
- scripts/gnt-cluster 1 addition, 1 deletionscripts/gnt-cluster
- scripts/gnt-node 1 addition, 1 deletionscripts/gnt-node
Loading
Please register or sign in to comment