config.generator yields incorrect output when the system hostname == a default value

Bug #1205411 reported by Ben Nemec on 2013-07-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Ben Nemec
oslo-incubator
Undecided
Ben Nemec

Bug Description

I found this in Nova, but I think it would apply in general.

This:

bnemec@openstack:/opt/stack/nova$ tools/config/generate_sample.sh -b . -p nova -o etc/nova

Results in this for me:

-#control_exchange=openstack
+#control_exchange=nova

Which breaks Jenkins. This is because the system hostname is openstack and the _sanitize_default function replaces all instances of the hostname with, in this case, 'nova'. I have an idea as to how to fix this and will push a patch shortly.

Ben Nemec (bnemec) on 2013-07-26
Changed in oslo:
assignee: nobody → Ben Nemec (bnemec)

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

Changed in oslo:
status: New → In Progress

Reviewed: https://review.openstack.org/38837
Committed: http://github.com/openstack/oslo-incubator/commit/7448e7e1df892cde1e7ab1cb61c24f62a4eae8da
Submitter: Jenkins
Branch: master

commit 7448e7e1df892cde1e7ab1cb61c24f62a4eae8da
Author: Ben Nemec <email address hidden>
Date: Fri Jul 26 11:34:17 2013 -0500

    Fix hostname conflict in config generator

    When the system hostname is the same as a default value in the
    config, the _sanitize_default function may replace it incorrectly.
    This change checks that the name of the option contains the
    substring 'host' to make sure it isn't changing non-hostname
    defaults.

    Fixes bug 1205411

    Change-Id: I93edb2902304c5cd9bfa817b1bccdaec5d807e6c

Changed in oslo:
status: In Progress → Fix Committed

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

Changed in nova:
assignee: nobody → Ben Nemec (bnemec)
status: New → In Progress

Reviewed: https://review.openstack.org/39601
Committed: http://github.com/openstack/nova/commit/d37eda9366b38b1bff0a95d0903d6799c900555e
Submitter: Jenkins
Branch: master

commit d37eda9366b38b1bff0a95d0903d6799c900555e
Author: Ben Nemec <email address hidden>
Date: Wed Jul 31 17:44:18 2013 -0500

    Sync config.generator from Oslo

    Includes:
    7448e7e Fix hostname conflict in config generator

    Fixes bug 1205411

    Change-Id: I13988ef73db05bbdab355400c19e1ad136b59fc0

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-09-05
Changed in nova:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-09-05
Changed in oslo:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in oslo:
milestone: havana-3 → 2013.2
Thierry Carrez (ttx) on 2013-10-17
Changed in nova:
milestone: havana-3 → 2013.2

Reviewed: https://review.openstack.org/83594
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=f44691ee6315f82342ed165405b5d26a13cce044
Submitter: Jenkins
Branch: master

commit f44691ee6315f82342ed165405b5d26a13cce044
Author: Ben Nemec <email address hidden>
Date: Thu Mar 27 21:30:27 2014 +0000

    Add test case for config generator hostname check

    When I fixed the referenced bug I failed to add a unit test to
    cover the error case, so it's been up to the reviewers to make sure
    it doesn't regress. Let's give the reviewers a break and add a
    proper test case.

    Change-Id: I46c0f082acd9da6e84c7ac4d4cba387ec97c23c8
    Related-Bug: #1205411

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

Other bug subscribers