Give instance default hostname if hostname is empty

Bug #1504213 reported by OpenStack Infra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Fix Released
Low
KATO Tomoyuki

Bug Description

https://review.openstack.org/227176
commit db45b1eca8a3db8f1b5153c58b138711ed69c388
Author: Eli Qiao <email address hidden>
Date: Thu Sep 17 13:57:24 2015 +0800

    Give instance default hostname if hostname is empty

    Instance hostname is generated by displayname, currently, displayname
    can be '----', and other Non-ASCII character such as Chinese characters,
    sanitize_hostname will return empty in such cases.

    This patch adds a helper function _default_host_name to give an instance
    default name if sanitize_hostname returns empty hostname. And,
    sanitize_hostname will truncated to 63 if the host name is too long.

    Also Window, Linux, and Dnsmasq have different limitation:

    Windows: 255 (net_bios limit to 15, but window will truncate it)
    Linux: 64
    Dnsmasq: 63

    Due to nova-network will leverage dnsmasq to set hostname, so we chose
    63.

    Besides, added more test cases to cover sanitize_hostname.

    DocImpact
    Closes-Bug: #1495388
    Co-authored-by: Alex Xu <email address hidden>

    (cherry picked from commit bc6f30de953303604625e84ad2345cfb595170d2)

    Conflicts:
     nova/tests/unit/compute/test_compute_api.py
     nova/tests/unit/test_utils.py
     nova/utils.py

    Change-Id: I443b51e0576cf657d96e498d6700bfc34d987301

Tags: nova
Changed in openstack-manuals:
assignee: nobody → Jaiveek Shah (jaiveek-shah)
Changed in openstack-manuals:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-manuals (master)

Fix proposed to branch: master
Review: https://review.openstack.org/336965

Changed in openstack-manuals:
assignee: Jaiveek Shah (jaiveek-shah) → KATO Tomoyuki (kato-tomoyuki)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-manuals (master)

Reviewed: https://review.openstack.org/336965
Committed: https://git.openstack.org/cgit/openstack/openstack-manuals/commit/?id=9b96fbcd4956059af0dc4e6dd426219f311f6778
Submitter: Jenkins
Branch: master

commit 9b96fbcd4956059af0dc4e6dd426219f311f6778
Author: KATO Tomoyuki <email address hidden>
Date: Mon Jul 4 10:53:14 2016 +0900

    [user-guide] add note about hostname 63 chars limitation

    Change-Id: Ic8618ba864d8341d4d4df103c8cd33f10ce64b27
    Closes-Bug: #1504213

Changed in openstack-manuals:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-manuals 15.0.0

This issue was fixed in the openstack/openstack-manuals 15.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.