Skip to content

Commit

Permalink
Foodcritic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nickola committed Feb 20, 2015
1 parent bef87d0 commit 6b2ceaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
maintainer "Nickolay Kovalev"
maintainer_email "nickola@nickola.ru"
license "Apache 2.0"
description "Creates \"authorized_keys\" in user \"~/.ssh\" directory from a data bag"
description "Creates \"authorized_keys\" in user \"~/.ssh\" directory from a data bag (encrypted data bag supported)"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.2.6"
version "1.2.7"

%w{ubuntu debian redhat centos fedora freebsd}.each do |os|
supports os
Expand Down
8 changes: 6 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@

if not bag_users.kind_of?(String) and not bag_users.kind_of?(Array) and bag_users['groups'] != nil
Array(bag_users['groups']).each do |group_name|
search(:users, 'groups:' + group_name) do |user|
ssh_keys += Array(user['ssh_keys'])
if not Chef::Config[:solo]
search(:users, 'groups:' + group_name) do |search_user|
ssh_keys += Array(search_user['ssh_keys'])
end
else
Chef::Log.warn("This recipe uses search for users detection by groups. Chef Solo does not support search.")
end
end
end
Expand Down

0 comments on commit 6b2ceaa

Please sign in to comment.