Skip to content

Commit

Permalink
Fix issue with configuration parameters.
Browse files Browse the repository at this point in the history
This is same fix as fnichol#48 expect applying it a little bit better to all of
the different provisioners.
  • Loading branch information
johnbellone committed Mar 17, 2014
1 parent 4a919cd commit cf505fd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ knife server bootstrap linode \
--ssh-password 'testing1234'
```

To spin up your Chef Server on Openstack:
To spin up your Chef Server on [OpenStack][openstack]:

```bash
knife server bootstrap openstack \
--node-name openstack.example.com \
--linode-node-name openstack \
--openstack-node-name openstack \
--openstack-username $OS_USERNAME \
--openstack-password $OS_PASSWORD \
--openstack-auth-url $OS_AUTH_URL \
Expand Down Expand Up @@ -646,3 +646,4 @@ Apache License, Version 2.0 (see [LICENSE][license])
[knife-openstack]: https://github.com/opscode/knife-openstack
[stevendanna]: https://github.com/stevendanna
[vagrant_site]: http://vagrantup.com/
[openstack]: http://openstack.org
3 changes: 2 additions & 1 deletion lib/chef/knife/server_bootstrap_ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def ec2_bootstrap
ENV['NO_TEST'] = "1" if config[:no_test]
bootstrap = Chef::Knife::Ec2ServerCreate.new
Chef::Knife::Ec2ServerCreate.options.keys.each do |attr|
bootstrap.config[attr] = config_val(attr)
value = config_val(attr)
bootstrap.config[attr] = value unless ((value.is_a?(Array) and value[1].nil?) or value.nil?)
end
bootstrap.config[:tags] = bootstrap_tags
bootstrap.config[:distro] = bootstrap_distro
Expand Down
3 changes: 2 additions & 1 deletion lib/chef/knife/server_bootstrap_linode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def linode_bootstrap
ENV['NO_TEST'] = "1" if config[:no_test]
bootstrap = Chef::Knife::LinodeServerCreate.new
Chef::Knife::LinodeServerCreate.options.keys.each do |attr|
bootstrap.config[attr] = config_val(attr)
value = config_val(attr)
bootstrap.config[attr] = value unless ((value.is_a?(Array) and value[1].nil?) or value.nil?)
end
bootstrap.config[:distro] = bootstrap_distro
bootstrap
Expand Down
3 changes: 2 additions & 1 deletion lib/chef/knife/server_bootstrap_openstack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def openstack_bootstrap
ENV['NO_TEST'] = "1" if config[:no_test]
bootstrap = Chef::Knife::OpenstackServerCreate.new
Chef::Knife::OpenstackServerCreate.options.keys.each do |attr|
bootstrap.config[attr] = config_val(attr)
value = config_val(attr)
bootstrap.config[attr] = value unless ((value.is_a?(Array) and value[1].nil?) or value.nil?)
end
bootstrap.config[:distro] = bootstrap_distro
bootstrap
Expand Down
3 changes: 2 additions & 1 deletion lib/chef/knife/server_bootstrap_standalone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def standalone_bootstrap
bootstrap = Chef::Knife::Bootstrap.new
bootstrap.name_args = [ config[:host] ]
Chef::Knife::Bootstrap.options.keys.each do |attr|
bootstrap.config[attr] = config_val(attr)
value = config_val(attr)
bootstrap.config[attr] = value unless ((value.is_a?(Array) and value[1].nil?) or value.nil?)
end
bootstrap.ui = self.ui
bootstrap.config[:distro] = bootstrap_distro
Expand Down
2 changes: 1 addition & 1 deletion lib/knife/server/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SSH
USER_SWITCH_COMMAND = %[sudo USER=root HOME="$(getent passwd root | cut -d : -f 6)"]

def initialize(params)
options = DEFAULT_OPTIONS.merge(params) { |k,o,n| o = n if n }
options = DEFAULT_OPTIONS.merge(params)

@host = options.delete(:host)
@user = options.delete(:user)
Expand Down

0 comments on commit cf505fd

Please sign in to comment.