Comment 8 for bug 1763776

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-tripleoclient (master)

Reviewed: https://review.opendev.org/655777
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=c925c3b93bf02538c9308baf91aa0c7cc6dd20e9
Submitter: Zuul
Branch: master

commit c925c3b93bf02538c9308baf91aa0c7cc6dd20e9
Author: Emilien Macchi <email address hidden>
Date: Thu Apr 25 15:38:41 2019 -0400

    undercloud: resolve undercloud_*_host

    The problem we're solving here is that our operators using SSL + FQDN
    based endpoints will have failures during the deployment because we
    don't lookup the FQDN into IP addresses, needed later in the deployment
    for proper binding.

    This patch transforms undercloud_*_host parameters into IP addresses:

    - We raise if lookup returns nothing.
    - We raise if lookup returns more than one IP.
    - We support both IPv4 and IPv6.
    - We raise if the IP is a loopback.
    - We raise if the returned IP is invalid.

    Utils changes:

    * Introduce utils.is_valid_ip.
      Return True if the IP is either v4 or v6. Return False otherwise.

    * Introduce utils.is_loopback.
      Return True if the given host is a loopback. Return False otherwise.

    * Introduce utils.get_host_ips.
      Returns a list of IPs for a host to lookup.

    * Introduce utils.get_single_ip.
      Translate an hostname or FQDN into an IP address if it is valid IP.
      Return it unchanged if it is an IPv4 or IPv6 address.
      If the host is not reachable, it'll raise an exception.
      By default it excludes the loopbacks but it can be allowed by setting
      allow_loopback = True.

    * Use utils.get_single_ip to translate undercloud_admin_host and
      undercloud_public_host to IP addresses.

    Related-Bug: #1763776
    Change-Id: Ic008cc758493aa95e8aa237d23c2f66c0a930509