[neutron] Different 'hostname' output on Ubuntu and CentOS

Bug #1394933 reported by Andrey Sledzinskiy
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Invalid
Medium
MOS Oslo
5.1.x
Won't Fix
Medium
MOS Oslo
6.0.x
Won't Fix
Medium
MOS Oslo
7.0.x
Invalid
Medium
Matthew Mosesohn

Bug Description

{

    "build_id": "2014-11-19_11-01-11",
    "ostf_sha": "85272980659a977582e5b2dc67479fe9d7c1bbe7",
    "build_number": "115",
    "auth_required": true,
    "api": "1.0",
    "nailgun_sha": "ffb507b8222f1529bca113489413ed536d2b517b",
    "production": "docker",
    "fuelmain_sha": "fc2c7b9deb0dad12482410d4750b264c57450c0c",
    "astute_sha": "65eb911c38afc0e23d187772f9a05f703c685896",
    "feature_groups": [
        "mirantis"
    ],
    "release": "6.0",
    "release_versions": {
        "2014.2-6.0": {
            "VERSION": {
                "build_id": "2014-11-19_11-01-11",
                "ostf_sha": "85272980659a977582e5b2dc67479fe9d7c1bbe7",
                "build_number": "115",
                "api": "1.0",
                "nailgun_sha": "ffb507b8222f1529bca113489413ed536d2b517b",
                "production": "docker",
                "fuelmain_sha": "fc2c7b9deb0dad12482410d4750b264c57450c0c",
                "astute_sha": "65eb911c38afc0e23d187772f9a05f703c685896",
                "feature_groups": [
                    "mirantis"
                ],
                "release": "6.0",
                "fuellib_sha": "74f7d1923d0b450be69850a82f3be8b17fc707c9"
            }
        }
    },
    "fuellib_sha": "74f7d1923d0b450be69850a82f3be8b17fc707c9"

}

On CentOS 'hostname' returns output like - node-6.test.domain.local
On Ubuntu it's like - node-6

Can we have the same output on Ubuntu and CentOS ?
It affects our system tests because we get hostname in different formats on Ubuntu and CentOS and we have to work-around it in tests

tags: added: low-hanging-fruit
Revision history for this message
Matthew Mosesohn (raytrac3r) wrote :

Use uname -n. It's what "facter" uses to identify hosts. It will return node-6.test.domain.local.

Revision history for this message
Matthew Mosesohn (raytrac3r) wrote :

And if you need to use Python to get this data, you can do this:
short_hostname, separator, domain = os.uname()[1].partition('.')
long_hostname = os.uname()[1]

Changed in fuel:
assignee: Fuel Library Team (fuel-library) → Matthew Mosesohn (raytrac3r)
status: New → Invalid
Revision history for this message
Andrey Sledzinskiy (asledzinskiy) wrote :

The problem isn't that I don't know how to get full hostname in tests, the problem is that different openstack clients that we use return different hostname format on Ubuntu and CentOS. And it happens I think because of hostname different output.
For example, hostname output of 'neutron dhcp-agent-list-hosting-net' differs on Ubuntu and CentOS but I want it to be the same

Changed in fuel:
status: Invalid → New
Revision history for this message
Matthew Mosesohn (raytrac3r) wrote :

Let's pass to neutron team to investigate how neutron identifies hostnames.

summary: - [library] Different output of 'hostname' command on Ubuntu and CentOS
+ [neutron] Different 'hostname' output on Ubuntu and CentOS
Changed in fuel:
assignee: Matthew Mosesohn (raytrac3r) → MOS Neutron (mos-neutron)
Changed in fuel:
milestone: 6.1 → 6.0
tags: added: neutron
Changed in fuel:
milestone: 6.0 → 6.0.1
Revision history for this message
Ilya Shakhat (shakhat) wrote :

The issue is in the way Fuel configures hostname and not related to Neutron. Clearing the tag and reassigning to fuel-library

tags: removed: neutron
Changed in fuel:
assignee: MOS Neutron (mos-neutron) → Fuel Library Team (fuel-library)
Revision history for this message
Matthew Mosesohn (raytrac3r) wrote :
Revision history for this message
Matthew Mosesohn (raytrac3r) wrote :
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

Pacemaker rely on crm_node -n, let's fix it in upstream and contribute to Fuel

Changed in fuel:
assignee: Fuel Library Team (fuel-library) → MOS Neutron (mos-neutron)
status: New → Triaged
milestone: 6.0.1 → 6.1
Revision history for this message
Matthew Mosesohn (raytrac3r) wrote :

This is actually being set in oslo.utils. We can see if this old bug can be resurrected by them.

Changed in fuel:
assignee: MOS Neutron (mos-neutron) → MOS Oslo (mos-oslo)
Revision history for this message
Dennis Dmitriev (ddmitriev) wrote :

The same issue on Ubuntu in Fuel 5.1.1

no longer affects: fuel/6.1.x
Revision history for this message
Dmitry Mescheryakov (dmitrymex) wrote :

The issue importance is less than high, hence we are not going to fix it in a maintenance release

Changed in fuel:
status: Triaged → Won't Fix
milestone: 6.1 → 7.0
Changed in fuel:
milestone: 7.0 → 6.1
Revision history for this message
Viktor Serhieiev (vsergeyev) wrote :

Folks, could you please explain more detailed - how this bug affects oslo.utils? It doesn't seem to be, that projects get hostname from there.

Revision history for this message
Vladimir Kuklin (vkuklin) wrote :

This is as-designed for all Linux distributions. Debian and CentOS always return different hostname command.

Use hostname -f or hostname -s for particular short or full names.

Moreover there is no CentOS in 7.0 - this bug is Invalid

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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