diff options
author | Igor Shpakov <igorshp@gmail.com> | 2015-02-03 16:00:48 +0000 |
---|---|---|
committer | Igor Shpakov <igorshp@gmail.com> | 2015-05-07 18:02:21 +0100 |
commit | f0c469daab37564be9e77c4f1ffdd6ee691e0ea5 (patch) | |
tree | 2fd981cd12cbc31897ee64a9c231f5bcd1421f0a /spec/functional | |
parent | 44d70ba0f1b38bc3e1170ae978ad5e9a11679df3 (diff) | |
download | chef-f0c469daab37564be9e77c4f1ffdd6ee691e0ea5.tar.gz |
Fix ssh attribute precedence order
Pick ssh attribute in following order:
1. command line
2. config file
3. cloud attribute
4. fqdn
Prioritise manual ssh attribute over defaults
Change history:
- knife:ssh; fixing tests
- updated based on @btm comments
- Removed configure_attributes and replaced it with get_ssh_attribute
- get_ssh_attribute on it's own returns only the name of the attribute to use. this makes testing easy. the order of precedence is defined in the comments
- updated functional tests
- changed :attribute_from_cli to :attribute
- @btm correctly noted that attribute_from_cli was a temporary variable and is no longer used
- updated tests to use the new format
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/knife/ssh_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb index 5b8ad6f368..6608d05771 100644 --- a/spec/functional/knife/ssh_spec.rb +++ b/spec/functional/knife/ssh_spec.rb @@ -165,7 +165,7 @@ describe Chef::Knife::Ssh do it "uses the ssh_attribute" do @knife.run - expect(@knife.config[:attribute]).to eq("ec2.public_hostname") + expect(@knife.get_ssh_attribute(Chef::Node.new)).to eq("ec2.public_hostname") end end @@ -177,7 +177,7 @@ describe Chef::Knife::Ssh do it "uses the default" do @knife.run - expect(@knife.config[:attribute]).to eq("fqdn") + expect(@knife.get_ssh_attribute(Chef::Node.new)).to eq("fqdn") end end |