diff options
author | Tim Smith <tsmith@chef.io> | 2020-06-23 23:26:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 23:26:01 -0700 |
commit | 8afc34172a1c8753127a6bb76107086558bbc6dc (patch) | |
tree | e9a300f377137ac2e5c78da6858a6ad7395002a5 | |
parent | 07f6280ee09ff1a7b0549db00bbd5fd81144470d (diff) | |
parent | 9a898a22d91b9a83919c03d03331acd463328d4d (diff) | |
download | chef-8afc34172a1c8753127a6bb76107086558bbc6dc.tar.gz |
Merge pull request #10047 from chef/fix-warning-in-test
Inline some constants to prevent redefenition warnings in tests.
-rw-r--r-- | lib/chef/knife/cookbook_upload.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/chef/knife/cookbook_upload.rb b/lib/chef/knife/cookbook_upload.rb index 1e5965f885..14e8419bec 100644 --- a/lib/chef/knife/cookbook_upload.rb +++ b/lib/chef/knife/cookbook_upload.rb @@ -23,9 +23,6 @@ require_relative "../knife" class Chef class Knife class CookbookUpload < Knife - CHECKSUM = "checksum".freeze - MATCH_CHECKSUM = /[0-9a-f]{32,}/.freeze - deps do require_relative "../mixin/file_class" include Chef::Mixin::FileClass @@ -245,7 +242,7 @@ class Chef # manifest object, but the manifest becomes invalid when you # regenerate the metadata broken_files = cookbook.dup.manifest_records_by_path.select do |path, info| - info[CHECKSUM].nil? || info[CHECKSUM] !~ MATCH_CHECKSUM + !/[0-9a-f]{32,}/.match?(info["checksum"]) end unless broken_files.empty? broken_filenames = Array(broken_files).map { |path, info| path } |