Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #300 from tmatilai/non-string-paths
Browse files Browse the repository at this point in the history
Print an error if a `*_path` configuration is not a String
  • Loading branch information
matschaffer committed Oct 19, 2013
2 parents cf64c79 + 9c455ec commit 382d017
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Follow symlinks when uploading kitchen ([279], [289])
* Quote rsync paths to avoid problems with spaces in directory names ([281], [286])
* Fix precedence of automatic cookbook_path components ([296], [298])
* Print an error message if a `*_path` configuration value is not a String ([278], [300])

## Thanks to our contributors!

Expand All @@ -25,6 +26,7 @@
[265]: https://github.com/matschaffer/knife-solo/issues/265
[268]: https://github.com/matschaffer/knife-solo/issues/268
[274]: https://github.com/matschaffer/knife-solo/issues/274
[278]: https://github.com/matschaffer/knife-solo/issues/278
[279]: https://github.com/matschaffer/knife-solo/issues/279
[281]: https://github.com/matschaffer/knife-solo/issues/281
[284]: https://github.com/matschaffer/knife-solo/issues/284
Expand All @@ -35,6 +37,7 @@
[295]: https://github.com/matschaffer/knife-solo/issues/295
[296]: https://github.com/matschaffer/knife-solo/issues/296
[298]: https://github.com/matschaffer/knife-solo/issues/298
[300]: https://github.com/matschaffer/knife-solo/issues/300

# 0.3.0 / 2013-08-01

Expand Down
6 changes: 4 additions & 2 deletions lib/chef/knife/solo_cook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def sync_kitchen
run_portable_mkdir_p(provisioning_path, '0700')

cookbook_paths.each_with_index do |path, i|
upload_to_provision_path(path, "/cookbooks-#{i + 1}", 'cookbook_path')
upload_to_provision_path(path.to_s, "/cookbooks-#{i + 1}", 'cookbook_path')
end
upload_to_provision_path(node_config, 'dna.json')
upload_to_provision_path(node_config.to_s, 'dna.json')
upload_to_provision_path(nodes_path, 'nodes')
upload_to_provision_path(:role_path, 'roles')
upload_to_provision_path(:data_bag_path, 'data_bags')
Expand Down Expand Up @@ -227,6 +227,8 @@ def upload_to_provision_path(src, dest, key_name = 'path')

if src.nil?
Chef::Log.debug "'#{key_name}' not set"
elsif !src.is_a?(String)
ui.error "#{key_name} is not a String: #{src.inspect}"
elsif !File.exist?(src)
ui.warn "Local #{key_name} '#{src}' does not exist"
else
Expand Down

0 comments on commit 382d017

Please sign in to comment.