semicolon separated parameters are not taken from CLI

Bug #1375759 reported by Anant Patil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-heatclient
Opinion
Undecided
Anant Patil

Bug Description

I tried to create a stack from CLI using following command:

heat stack-create hello -f /opt/stack/heat-templates/hot/hello_world.yaml --parameters key_name=heat_key;flavor=m1.tiny;admin_pass=admin;image=cirros-0.3.2-x86_64-uec

It fails with:
ERROR: The Parameter (admin_pass) was not provided.

When I print all the args from shell.py, it includes only the first parameter i.e. heat_key in this case.

Anant Patil (ananta)
description: updated
Changed in python-heatclient:
assignee: nobody → Anant Patil (ananta)
Revision history for this message
Anant Patil (ananta) wrote :

It looks like is a shell problem, the first semicolon terminating the CLI command. Either the semicolons should be escaped or the parameter key-value pairs must be enclosed in quotes.

-----------------------------------------------------------------
Example:

heat stack-create hello1 -f /opt/stack/heat-templates/hot/hello_world.yaml -P "flavor=m1.tiny;admin_pass=Admin24;image=cirros-0.3.2-x86_64-uec;key_name=heat-key"

or

heat stack-create hello -f /opt/stack/heat-templates/hot/hello_world.yaml -P flavor=m1.tiny\;admin_pass=admin\;image=cirros-0.3.2-x86_64-uec\;key_name=heat-key

-----------------------------------------------------------------

May be we should use some other character to separate the key-value pairs given in parameters?

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

I would recommend just specifying --parameters multiple times, ie

-P key_name=heat_key -P flavor=m1.tiny -P admin_pass=admin -P image=cirros-0.3.2-x86_64-uec

Changed in python-heatclient:
status: New → Invalid
Revision history for this message
Anant Patil (ananta) wrote :

While the recommendation sounds good, it doesn't address the problem.
We can specify the --parameters each time, but is tedious to type! The ability
to specify key-value pairs as semicolon separated values is really handy.

This bug was filed to bring to everyone's notice that if we don't take enough care w.r.t to
either fixing it or documenting it, the user can end-up with a stack with resources having
unintended properties. The first semicolon terminates the command, and the remaining
parameters are ignored, and default values for the remaining ones will be taken from the
template for creating resources, and that is not what user expected.

IMHO, the consequence of this must be carefully considered before marking it as invalid.

Anant Patil (ananta)
Changed in python-heatclient:
status: Invalid → Opinion
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

-P is much shorter than --parameters. Also semicolon works fine when the value is quoted. For these 2 reasons I don't see any issue which needs to be fixed.

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.