./tools/config/generate_sample.sh requires a -b parameter

Bug #1204204 reported by Alessandro Pilotti
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Zhongyue Luo
oslo-incubator
Fix Released
Wishlist
Ben Nemec

Bug Description

Based on:

https://github.com/openstack/nova/blob/ca08c4447a11192f5ca2a5a63ffe3f2656dda2b7/tools/config/README#L5

./tools/config/generate_sample.sh

should be executed in place of the previous:

./tools/conf/generate_sample.sh

The README file should be updated specifying that generate_sample.sh requires a mandatory -b / --base-dir parameter

Furthermore the path must not end with "/" or "nova" must be specified as package name (this is IMO a bug in the config script, so it can be considered related to oslo)

-o etc/nova must be specified as output directory as well.

e.g.:

WRONG - Will generate a file called ..conf.sample
./tools/config/generate_sample.sh -b /path/nova/ -o etc/nova

OK
./tools/config/generate_sample.sh -b /path/nova -o etc/nova

OK
/tools/config/generate_sample.sh -b . -p nova -o etc/nova

description: updated
description: updated
Matt Riedemann (mriedem)
affects: nova → oslo
Revision history for this message
Ben Nemec (bnemec) wrote :

Oh look, there's a bug for this. I've submitted a patch that simplifies running generate_sample.sh in Nova. With that it should be possible to run it with no parameters as long as you're in the root of the Nova tree (as in the examples above).

The change is here and I'll add this bug to the commit message when I get a chance: https://review.openstack.org/#/c/43160/

Changed in oslo:
status: New → In Progress
assignee: nobody → Ben Nemec (bnemec)
importance: Undecided → Wishlist
Revision history for this message
Zhongyue Luo (zyluo) wrote :

The last slash passed to -b (or --base-dir) is remove here https://github.com/openstack/oslo-incubator/blob/master/tools/config/generate_sample.sh#L28

I've also confirmed

./tools/config/generate_sample.sh -b /home/zyluo/git/nova/ -o etc/nova

works find in my env.

Zhongyue Luo (zyluo)
Changed in nova:
assignee: nobody → Zhongyue Luo (zyluo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

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

commit ff3b05b865ce9cf9dfba4b48cbb654f9b16b7854
Author: Zhongyue Luo <email address hidden>
Date: Thu Aug 22 10:15:14 2013 +0800

    Updates tools/config/README

    The sample command line lacks the arguments required for executing
    the script. Added the command line used in check_uptodate.sh

    Fixes bug #1204204

    Change-Id: I475491872577632c472695a3b1089caaf1f27d7c

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/43160
Committed: http://github.com/openstack/oslo-incubator/commit/8b11fda7b7b5e8e020c89435acc75a724bf8ea6d
Submitter: Jenkins
Branch: master

commit 8b11fda7b7b5e8e020c89435acc75a724bf8ea6d
Author: Ben Nemec <email address hidden>
Date: Wed Aug 21 09:08:28 2013 -0500

    Provide useful defaults for config generator

    Right now if you run generate_sample.sh in (for example) Nova,
    you have to provide all three parameters for it to work right.
    This change tweaks the defaults so that the script can be run
    from the root of the project directory with no parameters.
    This should apply to all of the projects, not just Nova.

    Closes-Bug: 1204204

    Change-Id: Iaa0a899dd4f34f44317f9574688e305365a604bf

Changed in oslo:
status: In Progress → Fix Committed
Revision history for this message
Zhongyue Luo (zyluo) wrote :

The bug in the script which generates a file called ..conf.sample happens when --base-dir is passed as "."
I'll submit another patch which exits the script if the packagename has no alphbets

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/43718
Committed: http://github.com/openstack/oslo-incubator/commit/33f9f78fdbe5cf850fcfde6331126c6475b9be56
Submitter: Jenkins
Branch: master

commit 33f9f78fdbe5cf850fcfde6331126c6475b9be56
Author: Zhongyue Luo <email address hidden>
Date: Mon Aug 26 23:28:32 2013 +0900

    Replaces relative path to absolute path in conf file generator

    The $OUTPUTFILE value is broken if the base-dir is passed as . or ..
    This patch replaces relative paths to absolute paths passed to base-dir and
    adds validation to $BASEDIR/$PACKAGENAME.

    Fixes bug #1204204

    Change-Id: Iaec57b0e9a2d53e7a601fe551e6ec4fd55da24b7

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → havana-3
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
Changed in nova:
importance: Undecided → Medium
status: Fix Released → In Progress
milestone: havana-3 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit a94232f79df0dbb2606300a7e07b6f965ceff68c
Author: Zhongyue Luo <email address hidden>
Date: Fri Aug 30 10:34:59 2013 +0800

    Update sample config generator script

    This patch reverts 13d80020. The help message should be added
    in oslo-incubator since generate_sample.sh is synced from there also.

    Resolves bug #1204204

    9f2b93b Sample config file generator clean up
    33f9f78 Replaces relative path to absolute path in conf file generator
    c97e17b Refactors if statement in config generator
    8b11fda Provide useful defaults for config generator
    4c02e0a Unset OS_xx variable before generate configuration

    Change-Id: I96fcb39c0c620c147fea5c96416e506a758619ce

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: havana-3 → 2013.2
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
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.