The way to fetch HOST_IP in local.conf.example can lead to invalid ip

Bug #1822557 reported by Lajos Katona
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-odl
Fix Released
Undecided
Lajos Katona

Bug Description

In local.conf.example the following line responsible for fetching the host ip:
HOST_IP=$(ip route get 8.8.8.8 | awk '{print $NF; exit}')

ip route get 8.8.8.8 can produce output like this:
$ ip route get 8.8.8.8
8.8.8.8 via 100.109.0.1 dev ens4 src 100.109.0.178 uid 1000
    cache

Thus awk '{print $NF; exit}' will produce 1000 in this case.

One solution for this can be:
- to use some other tool to fetch the IP of the host, like hostname -I | awk '{print $1}'
- As fetching the good ip can be problematic, leave HOST_IP empty, and warn the user of this example file to use the correct IP.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Changed in networking-odl:
assignee: nobody → Lajos Katona (lajos-katona)
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-odl (master)

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

Changed in networking-odl:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-odl (master)

Reviewed: https://review.openstack.org/650891
Committed: https://git.openstack.org/cgit/openstack/networking-odl/commit/?id=b5fa54c8298037763604dc36f93c642e82bd3993
Submitter: Zuul
Branch: master

commit b5fa54c8298037763604dc36f93c642e82bd3993
Author: Lajos Katona <email address hidden>
Date: Mon Apr 8 15:04:05 2019 +0200

    Fix HOST_IP fetching method in local.conf.example

    Change-Id: Iadc538c4714d6c802ae3031ffcd7cfe87bd7979d
    Closes-Bug: #1822557

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

This issue was fixed in the openstack/networking-odl 15.0.0.0b1 development milestone.

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.