knife-tidy 2.1.0 → 2.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a35c35e40e4f4c982f86ab15be05fa79192c55a8c748b4fd0a4dacb4e2332fee
4
- data.tar.gz: 7c1a6ac3c38567e5015520c66fb2431c161f1edc2c8af0335870b8d5f1afd183
3
+ metadata.gz: ebbadbfe49e6402c189f63e8e0290eeb93d409f89f4220ef9ad6bdc96b0b455f
4
+ data.tar.gz: ee7f3392eac804aeec3490c33c1e02d9d22d1bd038f3a1eb8222fd9d9c660dd9
5
5
  SHA512:
6
- metadata.gz: 40d92b7427aff1df3a7c4fcc7cc1df7742285cc5332b64e66213413b6dbc0a6e2b80d96554b2f76f21d3173499a53533d33366986f3b4446d09b5e42f312fc5a
7
- data.tar.gz: 1a34a9e016c5fcc1eb81bea371f7fae6a2ffa5faf48b7e83771aa2b354517c3b951970929dc58de230e2ade19ea6e0d8b1c77b74b5ad7e1d9ed256b4f38f45a9
6
+ metadata.gz: e78b266e0482121cd3d551a9d683cd79b85aae16bb31d53260c2c73a7ceae1080052cd582957b55a23099c7799ed8312e0a5fcde1b920640497af04872894ab7
7
+ data.tar.gz: b1e97749b9ed73fe512b76a45291541b070eb730ded2f86dc4de1f355258e319017338e183c53a0dd2b4671f98a513ba4a5ca69053e6dc834359f396e15257ee
@@ -10,9 +10,9 @@ class Chef
10
10
  require "chef/run_list"
11
11
  require_relative "../tidy_substitutions"
12
12
  require_relative "../tidy_acls"
13
- require "ffi_yajl"
14
- require "fileutils"
15
- require "securerandom"
13
+ require "ffi_yajl" unless defined?(FFI_Yajl)
14
+ require "fileutils" unless defined?(FileUtils)
15
+ require "securerandom" unless defined?(SecureRandom)
16
16
  end
17
17
 
18
18
  banner "knife tidy backup clean (options)"
@@ -25,7 +25,7 @@ class Chef
25
25
 
26
26
  option :gsub_file,
27
27
  long: "--gsub-file path/to/gsub/file",
28
- description: "The path to the file used for substitutions. If non-existant, a boiler plate one will be created."
28
+ description: "The path to the file used for substitutions. If non-existent, a boiler plate one will be created."
29
29
 
30
30
  option :gen_gsub,
31
31
  long: "--gen-gsub",
@@ -167,7 +167,7 @@ class Chef
167
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
- broken_cookooks_add(org, cookbook)
170
+ broken_cookbooks_add(org, cookbook)
171
171
  end
172
172
  end
173
173
  rescue LoadError, Exceptions::MetadataNotValid => e
@@ -175,7 +175,7 @@ class Chef
175
175
  exit 1
176
176
  end
177
177
 
178
- def broken_cookooks_add(org, cookbook_path)
178
+ def broken_cookbooks_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
181
  FileUtils.mv(cookbook_path, broken_path, verbose: true, force: true)
@@ -297,7 +297,7 @@ class Chef
297
297
 
298
298
  def substitutions_file
299
299
  sub_file_path = ::File.expand_path(config[:gsub_file])
300
- ui.error "Subtitutions file #{sub_file_path} does not exist!" unless ::File.exist?(sub_file_path)
300
+ ui.error "Substitutions file #{sub_file_path} does not exist!" unless ::File.exist?(sub_file_path)
301
301
  @substitutions_file ||= sub_file_path
302
302
  end
303
303
 
@@ -397,9 +397,10 @@ class Chef
397
397
  if existing_group_data["clients"].length != tidy.client_names(org).length
398
398
  ui.stdout.puts "REPAIRING: Adding #{(existing_group_data["clients"].length - tidy.client_names(org).length).abs} missing clients into #{org}'s client group file #{clients_group_path}"
399
399
  existing_group_data["clients"] = (existing_group_data["clients"] + tidy.client_names(org)).uniq
400
- ::File.open(clients_group_path, "w") do |f|
401
- f.write(Chef::JSONCompat.to_json_pretty(existing_group_data))
402
- end
400
+ end
401
+ existing_group_data["clients"] = existing_group_data["clients"].sort
402
+ ::File.open(clients_group_path, "w") do |f|
403
+ f.write(Chef::JSONCompat.to_json_pretty(existing_group_data))
403
404
  end
404
405
  end
405
406
 
@@ -4,7 +4,7 @@ class Chef
4
4
  class Knife
5
5
  class TidyNotify < Knife
6
6
  deps do
7
- require "ffi_yajl"
7
+ require "ffi_yajl" unless defined?(FFI_Yajl)
8
8
  require "net/smtp"
9
9
  end
10
10
 
@@ -14,39 +14,39 @@ class Chef
14
14
  short: "-s SERVER_NAME",
15
15
  long: "--smtp_server SERVER_NAME",
16
16
  default: "localhost",
17
- description: "SMTP Server to be used for emailling reports to organization admins (defaults to localhost)"
17
+ description: "SMTP Server to be used for emailing reports to organization admins (defaults to localhost)"
18
18
 
19
19
  option :smtp_port,
20
20
  short: "-p SMTP_PORT",
21
21
  long: "--smtp_port SMTP_PORT",
22
22
  default: 25,
23
- description: "SMTP port to be used for emailling reports to organization admins (defaults to 25)"
23
+ description: "SMTP port to be used for emailing reports to organization admins (defaults to 25)"
24
24
 
25
25
  option :smtp_helo,
26
26
  short: "-h SMTP_HELO",
27
27
  long: "--smtp_helo SMTP_HELO",
28
28
  default: "localhost",
29
- description: "SMTP HELO to be used for emailling reports to organization admins (defaults to localhost)"
29
+ description: "SMTP HELO to be used for emailing reports to organization admins (defaults to localhost)"
30
30
 
31
31
  option :smtp_username,
32
32
  short: "-u SMTP_USERNAME",
33
33
  long: "--smtp_username SMTP_USERNAME",
34
- description: "SMTP Username to be used for emailling reports to organization admins"
34
+ description: "SMTP Username to be used for emailing reports to organization admins"
35
35
 
36
36
  option :smtp_password,
37
37
  long: "--smtp_password SMTP_PASSWORD",
38
- description: "SMTP Password to be used for emailling reports to organization admins"
38
+ description: "SMTP Password to be used for emailing reports to organization admins"
39
39
 
40
40
  option :smtp_from,
41
41
  long: "--smtp_from SMTP_FROM",
42
- description: "SMTP From address to be used for emailling reports to organization admins"
42
+ description: "SMTP From address to be used for emailing reports to organization admins"
43
43
 
44
44
  option :smtp_use_tls,
45
45
  long: "--smtp_use_tls",
46
46
  short: "-t",
47
47
  default: false,
48
48
  boolean: true | false,
49
- description: "Whether TLS should be used for emailling reports to organization admins (defaults to false if omitted)"
49
+ description: "Whether TLS should be used for emailing reports to organization admins (defaults to false if omitted)"
50
50
 
51
51
  include Knife::TidyBase
52
52
 
@@ -6,7 +6,7 @@ class Chef
6
6
  include Knife::TidyBase
7
7
 
8
8
  deps do
9
- require "ffi_yajl"
9
+ require "ffi_yajl" unless defined?(FFI_Yajl)
10
10
  require "chef/util/threaded_job_queue"
11
11
  end
12
12
 
@@ -7,7 +7,7 @@ class Chef
7
7
  include Knife::TidyBase
8
8
 
9
9
  deps do
10
- require "ffi_yajl"
10
+ require "ffi_yajl" unless defined?(FFI_Yajl)
11
11
  end
12
12
 
13
13
  banner "knife tidy server report (options)"
@@ -108,7 +108,7 @@ class Chef
108
108
  action_needed(pre_12_3_message, server_warnings_file_path)
109
109
  end
110
110
  if unconverged_recent_nodes.length > 0
111
- unconverged_recent_message = "#{unconverged_recent_nodes.length} nodes have been created in the last hour that have yet to converge in organization #{org}. These nodes WILL NOT be factored in the stale cookbook verisons report. Continuing with the server cleanup will delete cookbooks in-use by these nodes."
111
+ unconverged_recent_message = "#{unconverged_recent_nodes.length} nodes have been created in the last hour that have yet to converge in organization #{org}. These nodes WILL NOT be factored in the stale cookbook versions report. Continuing with the server cleanup will delete cookbooks in-use by these nodes."
112
112
  ui.warn(unconverged_recent_message)
113
113
  action_needed(unconverged_recent_message, server_warnings_file_path)
114
114
  end
@@ -1,5 +1,5 @@
1
- require "ffi_yajl"
2
- require "fileutils"
1
+ require "ffi_yajl" unless defined?(FFI_Yajl)
2
+ require "fileutils" unless defined?(FileUtils)
3
3
  require "chef/log"
4
4
 
5
5
  class Chef
@@ -111,7 +111,7 @@ class Chef
111
111
 
112
112
  def add_client_to_org(actor)
113
113
  # TODO
114
- @tidy.ui.stdout.puts "ACTION NEEDED: Client referenced in acl non-existant: #{actor}"
114
+ @tidy.ui.stdout.puts "ACTION NEEDED: Client referenced in acl non-existent: #{actor}"
115
115
  end
116
116
 
117
117
  def add_actor_to_members(actor)
@@ -1,5 +1,5 @@
1
- require "ffi_yajl"
2
- require "fileutils"
1
+ require "ffi_yajl" unless defined?(FFI_Yajl)
2
+ require "fileutils" unless defined?(FileUtils)
3
3
  require "chef/knife/core/ui"
4
4
 
5
5
  class Chef
@@ -1,6 +1,6 @@
1
- require "ffi_yajl"
2
- require "tempfile"
3
- require "fileutils"
1
+ require "ffi_yajl" unless defined?(FFI_Yajl)
2
+ require "tempfile" unless defined?(Tempfile)
3
+ require "fileutils" unless defined?(FileUtils)
4
4
  require "chef/log"
5
5
 
6
6
  class Chef
@@ -1,4 +1,4 @@
1
1
  module KnifeTidy
2
- VERSION = "2.1.0".freeze
2
+ VERSION = "2.1.2".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.1.0
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2020-08-21 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