diff options
author | Tim Smith <tsmith@chef.io> | 2020-07-23 13:38:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-23 13:38:26 -0700 |
commit | 2c3895bb2bb44988a41350d09b351ab02f259a2b (patch) | |
tree | 9b5582cb2fb103fdb32733314bb7b0cb7c019992 | |
parent | 48db22f355b5f54f7227da81add48dd79def4ab7 (diff) | |
parent | e86b53c4d4b27be58a18f7bf98312251c42953a4 (diff) | |
download | chef-2c3895bb2bb44988a41350d09b351ab02f259a2b.tar.gz |
Merge pull request #10197 from chef/fix_inspector
Fix chef-resource-inspector to handle classes in equal_to
-rw-r--r-- | lib/chef/resource_inspector.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/resource_inspector.rb b/lib/chef/resource_inspector.rb index a12b06fcb2..53c0fbd913 100644 --- a/lib/chef/resource_inspector.rb +++ b/lib/chef/resource_inspector.rb @@ -59,11 +59,17 @@ module ResourceInspector required: opts[:required] || false, default: opts[:default_description] || get_default(opts[:default]), name_property: opts[:name_property] || false, - equal_to: Array(opts[:equal_to]).sort.map(&:inspect) } + equal_to: sort_equal_to(opts[:equal_to]) } end data end + def self.sort_equal_to(equal_to) + Array(equal_to).sort.map(&:inspect) + rescue ArgumentError + Array(equal_to).map(&:inspect) + end + def self.extract_cookbook(path, complete) path = File.expand_path(path) dir, name = File.split(path) |