knife-tidy 2.0.9 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4a97cf801ae4409e19040e77f743f2169d1e068401baae60529ad6d89f40798
4
- data.tar.gz: 84a994d03f9aa44208af4e227a97bc7beb230bb206421b02da166e23e87a479e
3
+ metadata.gz: 0e595827997c6dabb26499a048e0d2397ed46c44e3388e4249fbc5863e13d07e
4
+ data.tar.gz: efdadddefa1ec67b9e0c981c0acb558fb7d314859abca5689f211459c1575065
5
5
  SHA512:
6
- metadata.gz: 98873e41d798dbcb80ce8e1640e170edc635772c010f85c6cf736bcdcf483271c42c6afde97f1db9e573cb44a2c72d719546493f74cfd3e9680dd332862fedfd
7
- data.tar.gz: 3c179e8babe63a01eed66aa5a88c062a4540a7d885d1b978dcfdc60051f1e394925f8bf19c57ab39ccade673a7b323c558158644e68c136b696353cc1335cda5
6
+ metadata.gz: 2eec12d668fc17f93caf0db7329a3ebfca1717402a813d1ff43c6663f0b444ee26971a3ec6f0b8b54f72ea1b6896f4c688b7cda456db105f52c51f0862fd11fe
7
+ data.tar.gz: 375800be7993c24bccef71a5a27948ebe9d661b1ebddc5c640841fe8c0b339d9ccb98bdab470994fcea6e4386c9a64a0884a5970851ef2d2d45205d464586f1f
@@ -4,7 +4,7 @@ class Chef
4
4
  class Knife
5
5
  class TidyBackupClean < Knife
6
6
  deps do
7
- require "chef/cookbook_loader"
7
+ require "chef/cookbook/cookbook_version_loader"
8
8
  require "chef/cookbook/metadata"
9
9
  require "chef/role"
10
10
  require "chef/run_list"
@@ -161,26 +161,24 @@ class Chef
161
161
  end
162
162
 
163
163
  def load_cookbooks(org)
164
- cl = Chef::CookbookLoader.new(tidy.cookbooks_path(org))
165
- for_each_cookbook_basename(org) do |cookbook|
164
+ for_each_cookbook_path(org) do |cookbook|
165
+ cl = Chef::Cookbook::CookbookVersionLoader.new(cookbook)
166
166
  ui.stdout.puts "INFO: Loading #{cookbook}"
167
- ret = cl.load_cookbook(cookbook)
167
+ ret = cl.load!
168
168
  if ret.nil?
169
169
  action_needed("ACTION NEEDED: Something's wrong with the #{cookbook} cookbook in org #{org} - cannot load it! Moving to cookbooks.broken folder.")
170
170
  broken_cookooks_add(org, cookbook)
171
171
  end
172
172
  end
173
- rescue LoadError => e
173
+ rescue LoadError, Exceptions::MetadataNotValid => e
174
174
  ui.error e
175
175
  exit 1
176
176
  end
177
177
 
178
- def broken_cookooks_add(org, cookbook)
178
+ def broken_cookooks_add(org, cookbook_path)
179
179
  broken_path = ::File.join(tidy.org_path(org), "cookbooks.broken")
180
180
  FileUtils.mkdir(broken_path) unless ::File.directory?(broken_path)
181
- Dir[::File.join(tidy.cookbooks_path(org), "#{cookbook}*")].each do |cb|
182
- FileUtils.mv(cb, broken_path, verbose: true, force: true)
183
- end
181
+ FileUtils.mv(cookbook_path, broken_path, verbose: true, force: true)
184
182
  end
185
183
 
186
184
  def generate_new_metadata(org)
@@ -1,4 +1,4 @@
1
1
  module KnifeTidy
2
- VERSION = "2.0.9".freeze
2
+ VERSION = "2.0.11".freeze
3
3
  MAJOR, MINOR, TINY = VERSION.split(".")
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-tidy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-21 00:00:00.000000000 Z
11
+ date: 2020-04-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Report on stale Chef Server nodes and cookbooks and clean up data integrity
14
14
  issues in a knife-ec-backup object based backup