shotgun accidentally detects local host as a remote if host address was given as just IP

Bug #1506932 reported by Alexander Gordeev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Invalid
Medium
Maciej Kwiek

Bug Description

if fuel-master node host address is given in a form of IP
eg: 10.109.15.2

shotgun will then unable to detect that it's local source, not a remote one.

this happens because it's guessing local source by judging to socket.gethostname() and socket.getfqdn(socket.gethostname()) which never returns bare IP address.

https://github.com/stackforge/fuel-web/blob/066e257c6a0999d0719a9f3617b947d013ffc5bb/shotgun/shotgun/utils.py#L42

currently 100% reproducible on our custom BVT jobs

Revision history for this message
Alexander Gordeev (a-gordeev) wrote :
Changed in fuel:
status: New → Confirmed
Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

it seems that if master node has got few interfaces with IPs by default,
so utils.is_local() https://github.com/openstack/fuel-web/blob/066e257c6a0999d0719a9f3617b947d013ffc5bb/shotgun/shotgun/utils.py#L42

should then iterate over them to ensure that IP address belongs to master node. Poking with just socket.get<> is not enough.

http://paste.openstack.org/show/476891/

As you could notice, that utils.is_local() returns True only if fqdn was passed to it.

So, utils.is_local is definitely broken.

Changed in fuel:
status: Confirmed → Triaged
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Maciej Kwiek (maciej-iai)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to shotgun (master)

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

Changed in fuel:
status: Triaged → In Progress
Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

I believe this bug was superseded by a couple of another: https://bugs.launchpad.net/fuel/+bug/1517844 https://bugs.launchpad.net/fuel/+bug/1511730

shotgun's logic was heavily modified, hence utils.is_local is not used anymore. Marking as Invalid.

Changed in fuel:
status: In Progress → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on shotgun (master)

Change abandoned by Maciej Kwiek (<email address hidden>) on branch: master
Review: https://review.openstack.org/240530
Reason: The bug it fixes turned out to be invalid.

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

Other bug subscribers

Bug attachments

Remote bug watches

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