heat-db-setup has invalid syntax

Bug #1398535 reported by andersonvom
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
andersonvom

Bug Description

The script heat-db-setup contains syntax that is only valid in certain shells.

    ./bin/heat-db-setup: line 90: syntax error in conditional expression
    ./bin/heat-db-setup: line 90: syntax error near `7'
    ./bin/heat-db-setup: line 90: ` if [[ $ver >= 7 ]];then'

">=" should be changed to "-ge" in order to maintain compatibility.

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

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

Changed in heat:
assignee: nobody → andersonvom (andersonvom)
status: New → In Progress
Revision history for this message
Steven Hardy (shardy) wrote :

Isn't this tool deprecated?

I thought it was a legacy of when we used to provide scripts to install openstack, whereas now you should use devstack (or some other method) to install the DB, and just use heat-manage db_sync to apply the schema?

I've got no problem with your fix, but it would be interesting to know why you need the script (e.g do we actually have justification for maintaining it vs just removing it?)

Changed in heat:
importance: Undecided → Low
milestone: none → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/138525
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=6a1ff532f9b8f456a9fe49b989a58a844ee731f9
Submitter: Jenkins
Branch: master

commit 6a1ff532f9b8f456a9fe49b989a58a844ee731f9
Author: Anderson Mesquita <email address hidden>
Date: Tue Dec 2 15:31:04 2014 -0500

    Fix invalid syntax on heat-db-setup

    ">=" comparison is only supported in certain shells. This patch changes
    it to "-ge" to fix this.

    Change-Id: I2bf1294c31d38e18b02bebd190bd4bfa45beedc5
    Closes-Bug: #1398535

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
andersonvom (andersonvom) wrote :

Recently I've installed Heat by itself and noticed that just running heat-manage db_sync is not enough to get everything set up. IMO, running db_sync should also take care of creating the DB or, at the very least, tell the user to manually create the DB before running the script, instead of blowing up with "OperationalError".

As for the fix, well, since db_sync wasn't enough, I was creating the DB using heat-db-setup, which broke recently due to this change: I02e79a6f8da5bd082568c22d3efc4c231dfbd8c7 , so I assumed it was still being actively maintained. =)

Revision history for this message
andersonvom (andersonvom) wrote :
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-1 → 2015.1.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.