Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using osc-provision requires --num-etcd argument when it shouldn't #141

Open
oybed opened this issue Apr 1, 2016 · 2 comments
Open

using osc-provision requires --num-etcd argument when it shouldn't #141

oybed opened this issue Apr 1, 2016 · 2 comments

Comments

@oybed
Copy link
Member

oybed commented Apr 1, 2016

Running a plain "osc-provision" fails if the --num-etcd parameter isn't supplied. By default it should work the same way as it used to (i.e.: one etcd on the master) and don't error out.

Below is an example run:

./osc-provision --num-nodes=2 --key=obedin-ose3-pub-key
WARNING: Did not request a specific OSE version, or version not supported (3.0|3.1) - using default version/configuration
Provisioning Utility Host. This could take several minutes.
Complete!
Provisioning master. This could take several minutes.
Complete!
Provisioning -1 etcd. This could take several minutes.
ERROR (CommandError): num_instances should be >= 1
ERROR: Provisioning Failed.
@sabre1041
Copy link
Contributor

@oybed I ran through a fresh repository clone and did not run into this issue.

Could it possibly be an issue with the name of your key?

@oybed
Copy link
Member Author

oybed commented Apr 5, 2016

@sabre1041 @JaredBurck finally got a chance to look into this a bit more and I believe it's the if-statement with the double brackets causing the discrepancy (see below). And it could be because maybe we're running different shells or versions of the shell. In my case it is:

>> $SHELL --version
GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

The issue is that the if condition below doesn't work right in my case - i.e.: "-1 > 0" evaluates to true.

if [[ $num_etcd_instances > 0 ]]; then

I'd suggest changing this to the following to make it a bit more robust for various shells / versions:

if [ "${num_etcd_instances}" -gt "0" ]; then

... or, alternatively, the following is also A_OK, but I prefer the above:

if (("${num_etcd_instances}" > "0")); then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants