knife-tidy 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/chef/knife/tidy_backup_clean.rb +7 -9
- data/lib/knife-tidy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e595827997c6dabb26499a048e0d2397ed46c44e3388e4249fbc5863e13d07e
|
4
|
+
data.tar.gz: efdadddefa1ec67b9e0c981c0acb558fb7d314859abca5689f211459c1575065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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
|
-
|
165
|
-
|
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.
|
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,
|
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
|
-
|
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)
|
data/lib/knife-tidy/version.rb
CHANGED
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.
|
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:
|
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
|