Skip to content
  • Iustin Pop's avatar
    Introduce a wrapper for hostname resolving · 104f4ca1
    Iustin Pop authored
    
    
    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: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    104f4ca1