Router hostnames need validation

Bug #1496848 reported by Ryan Petrello
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Astara
Fix Released
High
Ryan Petrello
akanda
Fix Released
High
Ryan Petrello

Bug Description

akanda-rug uses the Neutron Router name to set the VM hostname, but it's very possible to choose a Router name that isn't a valid hostname. This causes router configuration to fail with the following exception:

https://github.com/stackforge/akanda-rug/blob/master/akanda/rug/api/configuration.py#L67

RuntimeError: Command '['sudo', '/bin/hostname', 'some_invalid_hostname?']' returned non-zero exit status 1: hostname: the specified hostname is invalid

We should add some validation to the rug to strip out non-valid characters from router hostnames.

description: updated
Changed in akanda:
assignee: nobody → Ryan Petrello (ryan-petrello)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to akanda-rug (master)

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

Changed in akanda:
status: New → In Progress
Changed in akanda:
milestone: none → liberty-rc1
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to akanda-rug (master)

Reviewed: https://review.openstack.org/224808
Committed: https://git.openstack.org/cgit/stackforge/akanda-rug/commit/?id=760df4839ef2f97a6825f852b87556569c6c03c7
Submitter: Jenkins
Branch: master

commit 760df4839ef2f97a6825f852b87556569c6c03c7
Author: Ryan Petrello <email address hidden>
Date: Thu Sep 17 09:08:45 2015 -0700

    Use a standard hostname to prevent setting invalid hostnames.

    It's possible for a tenant to change their router's name to something that's
    not a valid hostname. This uses a standard ak-<tenant-uuid> value that we can
    rely on.

    Change-Id: Id64f7c796f8ef01200f51494611458b5731149c8
    Fixes-bug: #1496848

Changed in akanda:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to akanda-rug (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/225913

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to akanda-rug (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/225914

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to akanda-rug (stable/juno)

Reviewed: https://review.openstack.org/225914
Committed: https://git.openstack.org/cgit/stackforge/akanda-rug/commit/?id=a966659b53982b7c16a982745e34c2375acfc913
Submitter: Jenkins
Branch: stable/juno

commit a966659b53982b7c16a982745e34c2375acfc913
Author: Ryan Petrello <email address hidden>
Date: Thu Sep 17 09:08:45 2015 -0700

    Use a standard hostname to prevent setting invalid hostnames.

    It's possible for a tenant to change their router's name to something that's
    not a valid hostname. This uses a standard ak-<tenant-uuid> value that we can
    rely on.

    Change-Id: Id64f7c796f8ef01200f51494611458b5731149c8
    Fixes-bug: #1496848
    (cherry picked from commit 760df4839ef2f97a6825f852b87556569c6c03c7)

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to akanda-rug (stable/kilo)

Reviewed: https://review.openstack.org/225913
Committed: https://git.openstack.org/cgit/stackforge/akanda-rug/commit/?id=4e76a098e7c972150cc3c707063511a00a77f6b2
Submitter: Jenkins
Branch: stable/kilo

commit 4e76a098e7c972150cc3c707063511a00a77f6b2
Author: Ryan Petrello <email address hidden>
Date: Thu Sep 17 09:08:45 2015 -0700

    Use a standard hostname to prevent setting invalid hostnames.

    It's possible for a tenant to change their router's name to something that's
    not a valid hostname. This uses a standard ak-<tenant-uuid> value that we can
    rely on.

    Change-Id: Id64f7c796f8ef01200f51494611458b5731149c8
    Fixes-bug: #1496848
    (cherry picked from commit 760df4839ef2f97a6825f852b87556569c6c03c7)

tags: added: in-stable-kilo
Changed in astara:
milestone: none → liberty-rc1
importance: Undecided → High
status: New → Fix Committed
Changed in akanda:
status: Fix Committed → Fix Released
Changed in astara:
assignee: nobody → Ryan Petrello (ryan-petrello)
status: Fix Committed → Fix Released
Changed in akanda:
milestone: liberty-rc1 → 7.0.0
Changed in astara:
milestone: liberty-rc1 → 7.0.0
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.