openvox 8.31.0 → 9.0.0.pre.alpha2

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.
@@ -34,13 +34,13 @@ class Puppet::Resource::Type
34
34
  EMPTY_ARRAY = [].freeze
35
35
 
36
36
  LOOKAROUND_OPERATORS = {
37
- "(" => 'lp',
38
- "?" => "qu",
39
- "<" => "lt",
40
- ">" => "gt",
41
- "!" => "ex",
42
- "=" => "eq",
43
- ")" => 'rp'
37
+ "(" => 'LP',
38
+ "?" => "QU",
39
+ "<" => "LT",
40
+ ">" => "GT",
41
+ "!" => "EX",
42
+ "=" => "EQ",
43
+ ")" => 'RP'
44
44
  }.freeze
45
45
 
46
46
  attr_accessor :file, :line, :doc, :code, :parent, :resource_type_collection, :override
@@ -206,7 +206,7 @@ class Puppet::Resource::Type
206
206
 
207
207
  def name
208
208
  if type == :node && name_is_regex?
209
- # Normalize lookaround regex pattern to a unique, lookup-safe lowercase string.
209
+ # Normalize lookarround regex patthern
210
210
  internal_name = @name.source.downcase.gsub(/\(\?[^)]*\)/) do |str|
211
211
  str.gsub(/./) { |ch| LOOKAROUND_OPERATORS[ch] || ch }
212
212
  end
@@ -121,10 +121,6 @@ class Puppet::SSL::StateMachine
121
121
  rescue Puppet::HTTP::ResponseError => e
122
122
  if e.response.code == 304
123
123
  Puppet.info(_("CA certificate is unmodified, using existing CA certificate"))
124
- # 304 confirms the local CA is current, so reset the TTL.
125
- # Otherwise ca_last_update (backed by ca.pem mtime) never advances
126
- # past the initial download and needs_refresh? triggers on every run.
127
- @cert_provider.ca_last_update = Time.now
128
124
  else
129
125
  Puppet.info(_("Failed to refresh CA certificate, using existing CA certificate: %{message}") % { message: e.message })
130
126
  end
@@ -223,8 +219,6 @@ class Puppet::SSL::StateMachine
223
219
  rescue Puppet::HTTP::ResponseError => e
224
220
  if e.response.code == 304
225
221
  Puppet.info(_("CRL is unmodified, using existing CRL"))
226
- # 304 confirms the local CRL is current, so reset the TTL.
227
- @cert_provider.crl_last_update = Time.now
228
222
  else
229
223
  Puppet.info(_("Failed to refresh CRL, using existing CRL: %{message}") % { message: e.message })
230
224
  end
@@ -86,21 +86,12 @@ module Puppet
86
86
  raise Puppet::Error,
87
87
  "Cannot create #{@resource[:path]}; parent directory #{parent} does not exist"
88
88
  end
89
- begin
90
- if mode
91
- Puppet::Util.withumask(0o00) do
92
- Dir.mkdir(@resource[:path], symbolic_mode_to_int(mode, 0o755, true))
93
- end
94
- else
95
- Dir.mkdir(@resource[:path])
89
+ if mode
90
+ Puppet::Util.withumask(0o00) do
91
+ Dir.mkdir(@resource[:path], symbolic_mode_to_int(mode, 0o755, true))
96
92
  end
97
- rescue Errno::EEXIST
98
- # Another process may have created the directory concurrently. If it
99
- # really is a directory now, treat that as success.
100
- #
101
- # Directory mode, and other properties, will be checked and enforced by
102
- # the call to `property_fix`.
103
- raise unless Puppet::FileSystem.directory?(@resource[:path])
93
+ else
94
+ Dir.mkdir(@resource[:path])
104
95
  end
105
96
  @resource.send(:property_fix)
106
97
  return :directory_created
@@ -18,14 +18,6 @@ module Puppet::Util
18
18
 
19
19
  require 'json'
20
20
 
21
- # Generator options equivalent to the `JSON::PRETTY_STATE_PROTOTYPE`
22
- # that json 2.x provided and json 3 removed.
23
- PRETTY_OPTIONS = { :indent => ' ', :space => ' ', :object_nl => "\n", :array_nl => "\n" }.freeze
24
-
25
- # Generator options that json 3 rejects as unknown. `quirks_mode` has been
26
- # a no-op since json 2.0, when quirks mode became the only mode.
27
- OBSOLETE_DUMP_OPTIONS = [:quirks_mode].freeze
28
-
29
21
  # Load the content from a file as JSON if
30
22
  # contents are in valid format. This method does not
31
23
  # raise error but returns `nil` when invalid file is
@@ -49,20 +41,16 @@ module Puppet::Util
49
41
  def self.load(string, options = {})
50
42
  string = string.read if string.respond_to?(:read)
51
43
 
52
- options = options.dup
53
44
  options[:symbolize_names] = true if options.delete(:symbolize_keys)
54
- # json 3 only accepts parser options as keyword arguments
55
- ::JSON.parse(string, **options)
45
+ ::JSON.parse(string, options)
56
46
  rescue JSON::ParserError => e
57
47
  raise Puppet::Util::Json::ParseError.build(e, string)
58
48
  end
59
49
 
60
50
  def self.dump(object, options = {})
61
51
  # Options is a state when we're being called recursively
62
- unless options.is_a?(JSON::State)
63
- options = options.dup
64
- OBSOLETE_DUMP_OPTIONS.each { |key| options.delete(key) }
65
- options.merge!(PRETTY_OPTIONS) if options.delete(:pretty)
52
+ if !options.is_a?(JSON::State) && options.delete(:pretty)
53
+ options.merge!(::JSON::PRETTY_STATE_PROTOTYPE.to_h)
66
54
  end
67
55
  object.to_json(options)
68
56
  end