Skip to content

Commit

Permalink
Fixed specs failure and updated code based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dheerajd-msys committed Jul 26, 2016
1 parent 189e80a commit cc0c68f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/chef/knife/ec2_server_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,9 @@ def bootstrap_common_params(bootstrap)
bootstrap.config[:first_boot_attributes_from_file] = locate_config_value(:first_boot_attributes_from_file)
bootstrap.config[:encrypted_data_bag_secret] = s3_secret || locate_config_value(:secret)
bootstrap.config[:encrypted_data_bag_secret_file] = locate_config_value(:secret_file)
#cl_secret needs to be set as chef checks for this key
Chef::Config[:knife][:cl_secret] = s3_secret if locate_config_value(:s3_secret)
# retrieving the secret from S3 is unique to knife-ec2, so we need to set "command line secret" to the value fetched from S3
# When linux vm is spawned, the chef's secret option proc function sets the value "command line secret" and this value is used to check if secret option is passed through command line
Chef::Knife::DataBagSecretOptions.set_cl_secret(s3_secret) if locate_config_value(:s3_secret)
bootstrap.config[:secret] = s3_secret || locate_config_value(:secret)
bootstrap.config[:secret_file] = locate_config_value(:secret_file)
bootstrap.config[:node_ssl_verify_mode] = locate_config_value(:node_ssl_verify_mode)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/ec2_server_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
end
end

description 'S3 secret test cases' do
describe 'S3 secret test cases' do
before do
Chef::Config[:knife][:s3_secret] =
's3://test.bucket/folder/encrypted_data_bag_secret'
Expand Down

0 comments on commit cc0c68f

Please sign in to comment.