openvox 9.0.0.pre.beta2 → 9.0.0.pre.rc2

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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -26
  3. data/Gemfile +5 -3
  4. data/Gemfile.lock +666 -0
  5. data/HISTORY.md +311 -0
  6. data/Rakefile +5 -6
  7. data/ext/debian/puppet.default +2 -2
  8. data/ext/debian/puppet.init +2 -2
  9. data/ext/windows/service/daemon.rb +1 -2
  10. data/lib/hiera/scope.rb +0 -2
  11. data/lib/puppet/agent/disabler.rb +1 -1
  12. data/lib/puppet/agent/locker.rb +1 -1
  13. data/lib/puppet/agent.rb +79 -7
  14. data/lib/puppet/application/agent.rb +19 -4
  15. data/lib/puppet/application/ssl.rb +7 -6
  16. data/lib/puppet/application.rb +1 -2
  17. data/lib/puppet/configurer/fact_handler.rb +5 -1
  18. data/lib/puppet/confine.rb +1 -2
  19. data/lib/puppet/environments.rb +3 -12
  20. data/lib/puppet/face/epp.rb +0 -2
  21. data/lib/puppet/file_bucket/dipper.rb +0 -2
  22. data/lib/puppet/file_serving/content.rb +1 -2
  23. data/lib/puppet/file_serving/mount.rb +1 -2
  24. data/lib/puppet/functions/tree_each.rb +1 -1
  25. data/lib/puppet/generate/type.rb +1 -1
  26. data/lib/puppet/gettext/config.rb +0 -2
  27. data/lib/puppet/graph/simple_graph.rb +0 -2
  28. data/lib/puppet/http/service.rb +46 -17
  29. data/lib/puppet/indirector/facts/facter.rb +13 -12
  30. data/lib/puppet/indirector/file_bucket_file/file.rb +0 -2
  31. data/lib/puppet/interface/action.rb +1 -1
  32. data/lib/puppet/module.rb +1 -6
  33. data/lib/puppet/node.rb +5 -1
  34. data/lib/puppet/parser/ast.rb +1 -2
  35. data/lib/puppet/parser/compiler/catalog_validator.rb +1 -2
  36. data/lib/puppet/parser/files.rb +0 -2
  37. data/lib/puppet/parser/resource.rb +0 -4
  38. data/lib/puppet/parser/scope.rb +1 -5
  39. data/lib/puppet/pops/adaptable.rb +0 -2
  40. data/lib/puppet/pops/loader/base_loader.rb +0 -2
  41. data/lib/puppet/pops/loader/loader.rb +0 -2
  42. data/lib/puppet/pops/loader/runtime3_type_loader.rb +0 -2
  43. data/lib/puppet/pops/loaders.rb +0 -2
  44. data/lib/puppet/pops/lookup/hiera_config.rb +0 -2
  45. data/lib/puppet/pops/lookup/interpolation.rb +0 -2
  46. data/lib/puppet/pops/lookup/key_recorder.rb +2 -4
  47. data/lib/puppet/pops/lookup/lookup_key.rb +0 -2
  48. data/lib/puppet/pops/merge_strategy.rb +1 -1
  49. data/lib/puppet/pops/migration/migration_checker.rb +1 -2
  50. data/lib/puppet/pops/parser/lexer2.rb +2 -2
  51. data/lib/puppet/pops/parser/lexer_support.rb +0 -2
  52. data/lib/puppet/pops/parser/locatable.rb +2 -4
  53. data/lib/puppet/pops/parser/locator.rb +9 -18
  54. data/lib/puppet/pops/puppet_stack.rb +1 -1
  55. data/lib/puppet/pops/time/timespan.rb +0 -2
  56. data/lib/puppet/pops/types/class_loader.rb +1 -3
  57. data/lib/puppet/pops/types/iterable.rb +0 -2
  58. data/lib/puppet/pops/types/p_runtime_type.rb +0 -2
  59. data/lib/puppet/pops/types/p_timespan_type.rb +1 -3
  60. data/lib/puppet/pops/types/puppet_object.rb +2 -4
  61. data/lib/puppet/pops/types/type_acceptor.rb +1 -2
  62. data/lib/puppet/pops/types/type_factory.rb +1 -1
  63. data/lib/puppet/pops/types/types.rb +1 -8
  64. data/lib/puppet/pops/utils.rb +0 -6
  65. data/lib/puppet/pops/validation/checker4_0.rb +2 -6
  66. data/lib/puppet/pops/visitor.rb +1 -1
  67. data/lib/puppet/property/ensure.rb +0 -4
  68. data/lib/puppet/provider/nameservice.rb +0 -2
  69. data/lib/puppet/provider/network_device.rb +1 -2
  70. data/lib/puppet/provider/package/pkgdmg.rb +0 -2
  71. data/lib/puppet/provider/package/portage.rb +1 -1
  72. data/lib/puppet/provider/package/portupgrade.rb +2 -2
  73. data/lib/puppet/provider/parsedfile.rb +0 -2
  74. data/lib/puppet/provider/service/base.rb +2 -4
  75. data/lib/puppet/provider/service/launchd.rb +1 -1
  76. data/lib/puppet/provider/service/openwrt.rb +1 -2
  77. data/lib/puppet/provider/service/service.rb +1 -2
  78. data/lib/puppet/provider/service/smf.rb +6 -6
  79. data/lib/puppet/provider/service/systemd.rb +0 -41
  80. data/lib/puppet/provider/service/upstart.rb +1 -1
  81. data/lib/puppet/provider/user/directoryservice.rb +3 -5
  82. data/lib/puppet/reference/metaparameter.rb +1 -1
  83. data/lib/puppet/settings.rb +0 -2
  84. data/lib/puppet/test/test_helper.rb +1 -2
  85. data/lib/puppet/transaction/event.rb +0 -1
  86. data/lib/puppet/transaction/persistence.rb +0 -2
  87. data/lib/puppet/type/component.rb +1 -2
  88. data/lib/puppet/type/file.rb +1 -3
  89. data/lib/puppet/type/resources.rb +0 -2
  90. data/lib/puppet/type/user.rb +0 -2
  91. data/lib/puppet/type.rb +4 -15
  92. data/lib/puppet/util/at_fork/noop.rb +3 -6
  93. data/lib/puppet/util/fileparsing.rb +0 -6
  94. data/lib/puppet/util/filetype.rb +0 -2
  95. data/lib/puppet/util/ldap/generator.rb +0 -2
  96. data/lib/puppet/util/network_device/transport/base.rb +2 -4
  97. data/lib/puppet/util/rdoc/code_objects.rb +1 -1
  98. data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +3 -2
  99. data/lib/puppet/util/selinux.rb +16 -1
  100. data/lib/puppet/util/symbolic_file_mode.rb +2 -2
  101. data/lib/puppet/util/windows/file.rb +0 -1
  102. data/lib/puppet/version.rb +1 -1
  103. data/man/man8/puppet-agent.8 +7 -3
  104. data/tasks/vox.rake +2 -2
  105. metadata +4 -2
@@ -100,8 +100,6 @@ module Puppet::Pops::Types
100
100
  Iterator.new(PUnitType::DEFAULT, o.times)
101
101
  elsif o > 0
102
102
  IntegerRangeIterator.new(PIntegerType.new(0, o - 1))
103
- else
104
- nil
105
103
  end
106
104
  when PIntegerType
107
105
  # a finite range will always produce at least one element since it's inclusive
@@ -81,8 +81,6 @@ class PRuntimeType < PAnyType
81
81
  if @name_or_pattern.is_a?(Array)
82
82
  substituted = puppet_name.sub(*@name_or_pattern)
83
83
  substituted == puppet_name ? nil : PRuntimeType.new(@runtime, substituted)
84
- else
85
- nil
86
84
  end
87
85
  end
88
86
 
@@ -88,8 +88,6 @@ module Types
88
88
  new_min = numeric_from <= o.numeric_from ? numeric_from : o.numeric_from
89
89
  new_max = numeric_to >= o.numeric_to ? numeric_to : o.numeric_to
90
90
  self.class.new(new_min, new_max)
91
- else
92
- nil
93
91
  end
94
92
  end
95
93
 
@@ -112,7 +110,7 @@ module Types
112
110
  end
113
111
 
114
112
  dispatch :from_seconds do
115
- param 'Variant[Integer,Float]', :seconds
113
+ param 'Variant[Integer,Float]', :seconds
116
114
  end
117
115
 
118
116
  dispatch :from_string do
@@ -23,11 +23,9 @@ module PuppetObject
23
23
  t
24
24
  end
25
25
 
26
- def _pcore_all_contents(path, &block)
27
- end
26
+ def _pcore_all_contents(path, &block); end
28
27
 
29
- def _pcore_contents
30
- end
28
+ def _pcore_contents; end
31
29
 
32
30
  def _pcore_init_hash
33
31
  {}
@@ -13,8 +13,7 @@ module Types
13
13
  module TypeAcceptor
14
14
  # @param type [PAnyType] the type that we accept a visit from
15
15
  # @param guard [RecursionGuard] the guard against self recursion
16
- def visit(type, guard)
17
- end
16
+ def visit(type, guard); end
18
17
  end
19
18
 
20
19
  # An acceptor that does nothing
@@ -268,7 +268,7 @@ module TypeFactory
268
268
  # @api public
269
269
  #
270
270
  def self.regexp(pattern = nil)
271
- pattern ? PRegexpType.new(pattern) : PRegexpType::DEFAULT
271
+ pattern ? PRegexpType.new(pattern) : PRegexpType::DEFAULT
272
272
  end
273
273
 
274
274
  def self.pattern(*regular_expressions)
@@ -182,8 +182,7 @@ class PAnyType < TypedModelObject
182
182
  # @param originator [PTypeAliasType] the starting point for the check
183
183
  # @raise Puppet::Error if an illegal self recursion is detected
184
184
  # @api private
185
- def check_self_recursion(originator)
186
- end
185
+ def check_self_recursion(originator); end
187
186
 
188
187
  # Generalizes value specific types. Types that are not value specific will return `self` otherwise
189
188
  # the generalized type is returned.
@@ -521,8 +520,6 @@ class PTypeType < PTypeWithContainedType
521
520
  # @type describes the element type perfectly since the iteration is made over the
522
521
  # specified range.
523
522
  @type.finite_range? ? PIterableType.new(@type) : nil
524
- else
525
- nil
526
523
  end
527
524
  end
528
525
 
@@ -1050,8 +1047,6 @@ class PIntegerType < PNumericType
1050
1047
  min = @from <= o.numeric_from ? @from : o.numeric_from
1051
1048
  max = @to >= o.numeric_to ? @to : o.numeric_to
1052
1049
  PIntegerType.new(min, max)
1053
- else
1054
- nil
1055
1050
  end
1056
1051
  end
1057
1052
 
@@ -1224,8 +1219,6 @@ class PFloatType < PNumericType
1224
1219
  min = @from <= o.from ? @from : o.from
1225
1220
  max = @to >= o.to ? @to : o.to
1226
1221
  PFloatType.new(min, max)
1227
- else
1228
- nil
1229
1222
  end
1230
1223
  end
1231
1224
 
@@ -30,8 +30,6 @@ module Utils
30
30
  fp_value = Float(match[2])
31
31
  if fp_value != Float::INFINITY
32
32
  match[1] == '-' ? -fp_value : fp_value
33
- else
34
- nil
35
33
  end
36
34
  end
37
35
  end
@@ -69,8 +67,6 @@ module Utils
69
67
  when Numeric
70
68
  # Impossible to calculate radix, assume decimal
71
69
  [o, 10]
72
- else
73
- nil
74
70
  end
75
71
  rescue ArgumentError
76
72
  nil
@@ -94,8 +90,6 @@ module Utils
94
90
  end
95
91
  when Numeric
96
92
  o
97
- else
98
- nil
99
93
  end
100
94
  rescue ArgumentError
101
95
  nil
@@ -185,8 +185,7 @@ class Checker4_0 < Evaluator::LiteralEvaluator
185
185
 
186
186
  #---CHECKS
187
187
 
188
- def check_Object(o)
189
- end
188
+ def check_Object(o); end
190
189
 
191
190
  def check_Factory(o)
192
191
  check(o.model)
@@ -753,8 +752,7 @@ class Checker4_0 < Evaluator::LiteralEvaluator
753
752
  # other names). This means that (if the lexer/parser so chooses) a QualifiedName
754
753
  # can be anything when it represents a Bare Word and evaluates to a String.
755
754
  #
756
- def check_QualifiedName(o)
757
- end
755
+ def check_QualifiedName(o); end
758
756
 
759
757
  # Checks that the value is a valid UpperCaseWord (a CLASSREF), and optionally if it contains a hypen.
760
758
  # DOH: QualifiedReferences are created with LOWER CASE NAMES at parse time
@@ -1146,8 +1144,6 @@ class Checker4_0 < Evaluator::LiteralEvaluator
1146
1144
  o.value
1147
1145
  when Model::QualifiedReference
1148
1146
  o.value
1149
- else
1150
- nil
1151
1147
  end
1152
1148
  end
1153
1149
  end
@@ -23,7 +23,7 @@ class Visitor
23
23
  @message = message
24
24
  @min_args = min_args
25
25
  @max_args = max_args
26
- @cache = Hash.new
26
+ @cache = {}
27
27
  end
28
28
 
29
29
  # Visit the configured receiver
@@ -34,8 +34,6 @@ class Puppet::Property::Ensure < Puppet::Property
34
34
  defaultto do
35
35
  if @resource.managed?
36
36
  :present
37
- else
38
- nil
39
37
  end
40
38
  end
41
39
 
@@ -100,8 +98,6 @@ class Puppet::Property::Ensure < Puppet::Property
100
98
  defaultto do
101
99
  if @resource.managed?
102
100
  :present
103
- else
104
- nil
105
101
  end
106
102
  end
107
103
  end
@@ -115,8 +115,6 @@ class Puppet::Provider::NameService < Puppet::Provider
115
115
  value
116
116
  elsif respond_to?("autogen_#{field}")
117
117
  send("autogen_#{field}")
118
- else
119
- nil
120
118
  end
121
119
  end
122
120
  end
@@ -61,8 +61,7 @@ class Puppet::Provider::NetworkDevice < Puppet::Provider
61
61
  @property_hash.clear
62
62
  end
63
63
 
64
- def self.instances
65
- end
64
+ def self.instances; end
66
65
 
67
66
  def former_properties
68
67
  @properties.dup
@@ -138,8 +138,6 @@ Puppet::Type.type(:package).provide :pkgdmg, :parent => Puppet::Provider::Packag
138
138
  if Puppet::FileSystem.exist?("/var/db/.puppet_pkgdmg_installed_#{@resource[:name]}")
139
139
  Puppet.debug "/var/db/.puppet_pkgdmg_installed_#{@resource[:name]} found"
140
140
  { :name => @resource[:name], :ensure => :present }
141
- else
142
- nil
143
141
  end
144
142
  end
145
143
 
@@ -179,7 +179,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
179
179
 
180
180
  if @resource[:name] =~ /^@/
181
181
  if package_sets.include?(@resource[:name][1..].to_s)
182
- return({ :name => (@resource[:name]).to_s, :ensure => '9999', :version_available => nil, :installed_versions => nil, :installable_versions => "9999," })
182
+ return ({ :name => (@resource[:name]).to_s, :ensure => '9999', :version_available => nil, :installed_versions => nil, :installable_versions => "9999," })
183
183
  end
184
184
  end
185
185
 
@@ -39,7 +39,7 @@ Puppet::Type.type(:package).provide :portupgrade, :parent => Puppet::Provider::P
39
39
  # Corresponding field names
40
40
  fields = [:portname, :ensure, :portorigin]
41
41
  # define Temporary hash used, packages array of hashes
42
- hash = Hash.new
42
+ hash = {}
43
43
  packages = []
44
44
 
45
45
  # exec command
@@ -173,7 +173,7 @@ Puppet::Type.type(:package).provide :portupgrade, :parent => Puppet::Provider::P
173
173
  # Check: if output isn't in the right format, return nil
174
174
  if output =~ /^(\S+)-([^-\s]+)/
175
175
  # Fill in the details
176
- hash = Hash.new
176
+ hash = {}
177
177
  hash[:portorigin] = name
178
178
  hash[:portname] = Regexp.last_match(1)
179
179
  hash[:ensure] = Regexp.last_match(2)
@@ -189,8 +189,6 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
189
189
  @property_hash[attr] || :absent
190
190
  elsif defined?(@resource)
191
191
  @resource.should(attr)
192
- else
193
- nil
194
192
  end
195
193
  end
196
194
 
@@ -90,8 +90,7 @@ Puppet::Type.type(:service).provide :base, :parent => :service do
90
90
  end
91
91
 
92
92
  # There is no default command, which causes other methods to be used
93
- def statuscmd
94
- end
93
+ def statuscmd; end
95
94
 
96
95
  # Run the 'start' parameter command, or the specified 'startcmd'.
97
96
  def start
@@ -130,6 +129,5 @@ Puppet::Type.type(:service).provide :base, :parent => :service do
130
129
  end
131
130
 
132
131
  # There is no default command, which causes other methods to be used
133
- def stopcmd
134
- end
132
+ def stopcmd; end
135
133
  end
@@ -184,7 +184,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
184
184
  # This status method lists out all currently running services.
185
185
  # This hash is returned at the end of the method.
186
186
  def self.job_list
187
- @job_list = Hash.new
187
+ @job_list = {}
188
188
  begin
189
189
  output = launchctl :list
190
190
  raise Puppet::Error, "launchctl list failed to return any data." if output.nil?
@@ -32,6 +32,5 @@ Puppet::Type.type(:service).provide :openwrt, :parent => :init, :source => :init
32
32
 
33
33
  # Purposely leave blank so we fail back to ps based status detection
34
34
  # As OpenWrt init script do not have status commands
35
- def statuscmd
36
- end
35
+ def statuscmd; end
37
36
  end
@@ -19,8 +19,7 @@ Puppet::Type.type(:service).provide :service do
19
19
  end
20
20
 
21
21
  # There is no default command, which causes other methods to be used
22
- def restartcmd
23
- end
22
+ def restartcmd; end
24
23
 
25
24
  # @deprecated because the exit status is not returned, use service_execute instead
26
25
  def texecute(type, command, fof = true, squelch = false, combine = true)
@@ -39,12 +39,12 @@ Puppet::Type.type(:service).provide :smf, :parent => :base do
39
39
  service_instances.collect! do |line|
40
40
  state, fmri = line.split(/\s+/)
41
41
 
42
- status = case state
43
- when /online/; :running
44
- when /maintenance/; :maintenance
45
- when /degraded/; :degraded
46
- else :stopped
47
- end
42
+ status = case state
43
+ when /online/; :running
44
+ when /maintenance/; :maintenance
45
+ when /degraded/; :degraded
46
+ else :stopped
47
+ end
48
48
  new({ :name => fmri, :ensure => status })
49
49
  end
50
50
 
@@ -83,17 +83,6 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
83
83
  systemctl_change_enable(:disable)
84
84
  end
85
85
 
86
- def get_start_link_count
87
- # Start links don't include '.service'. Just search for the service name.
88
- if @resource[:name] =~ /\.service/
89
- link_name = @resource[:name].split('.')[0]
90
- else
91
- link_name = @resource[:name]
92
- end
93
-
94
- Dir.glob("/etc/rc*.d/S??#{link_name}").length
95
- end
96
-
97
86
  def cached_enabled?
98
87
  return @cached_enabled if @cached_enabled
99
88
 
@@ -118,39 +107,9 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
118
107
  return :false if output == 'indirect'
119
108
  return :true if code == 0
120
109
 
121
- if output.empty? && (code > 0) && Puppet.runtime[:facter].value('os.family').casecmp('debian').zero?
122
- ret = debian_enabled?
123
- return ret if ret
124
- end
125
-
126
110
  :false
127
111
  end
128
112
 
129
- # This method is required for Debian systems due to the way the SysVInit-Systemd
130
- # compatibility layer works. When we are trying to manage a service which does not
131
- # have a Systemd unit file, we need to go through the old init script to determine
132
- # whether it is enabled or not. See PUP-5016 for more details.
133
- #
134
- def debian_enabled?
135
- status = execute(["/usr/sbin/invoke-rc.d", "--quiet", "--query", @resource[:name], "start"], :failonfail => false)
136
- if [104, 106].include?(status.exitstatus)
137
- :true
138
- elsif [101, 105].include?(status.exitstatus)
139
- # 101 is action not allowed, which means we have to do the check manually.
140
- # 105 is unknown, which generally means the initscript does not support query
141
- # The debian policy states that the initscript should support methods of query
142
- # For those that do not, perform the checks manually
143
- # http://www.debian.org/doc/debian-policy/ch-opersys.html
144
- if get_start_link_count >= 4
145
- :true
146
- else
147
- :false
148
- end
149
- else
150
- :false
151
- end
152
- end
153
-
154
113
  # Define the daemon_reload? function to check if the unit is requiring to trigger a "systemctl daemon-reload"
155
114
  # If the unit file is flagged with NeedDaemonReload=yes, then a systemd daemon-reload will be run.
156
115
  # If multiple unit files have been updated, the first one flagged will trigger the daemon-reload for all of them.
@@ -166,7 +166,7 @@ Puppet::Type.type(:service).provide :upstart, :parent => :debian do
166
166
  end
167
167
 
168
168
  def stopcmd
169
- is_upstart? ? [command(:stop), @resource[:name]] : super
169
+ is_upstart? ? [command(:stop), @resource[:name]] : super
170
170
  end
171
171
 
172
172
  def restartcmd
@@ -288,8 +288,6 @@ Puppet::Type.type(:user).provide :directoryservice do
288
288
  '/bin/bash'
289
289
  when :home
290
290
  "/Users/#{@resource.name}"
291
- else
292
- nil
293
291
  end
294
292
  end
295
293
 
@@ -642,7 +640,7 @@ Puppet::Type.type(:user).provide :directoryservice do
642
640
  # set_shadow_hash_data method to serialize and write the plist to disk.
643
641
  def set_salted_sha512(users_plist, shadow_hash_data, value)
644
642
  unless shadow_hash_data
645
- shadow_hash_data = Hash.new
643
+ shadow_hash_data = {}
646
644
  shadow_hash_data['SALTED-SHA512'] = ''.dup
647
645
  end
648
646
  shadow_hash_data['SALTED-SHA512'] = base64_decode_string(value)
@@ -659,8 +657,8 @@ Puppet::Type.type(:user).provide :directoryservice do
659
657
  # the user's plist itself, and the shadow_hash_data hash containing the
660
658
  # existing PBKDF2 values.
661
659
  def set_salted_pbkdf2(users_plist, shadow_hash_data, field, value)
662
- shadow_hash_data ||= Hash.new
663
- shadow_hash_data['SALTED-SHA512-PBKDF2'] = Hash.new unless shadow_hash_data['SALTED-SHA512-PBKDF2']
660
+ shadow_hash_data ||= {}
661
+ shadow_hash_data['SALTED-SHA512-PBKDF2'] = {} unless shadow_hash_data['SALTED-SHA512-PBKDF2']
664
662
  case field
665
663
  when 'salt', 'entropy'
666
664
  shadow_hash_data['SALTED-SHA512-PBKDF2'][field] = Puppet::Util::Plist.string_to_blob(base64_decode_string(value))
@@ -14,7 +14,7 @@ etc.), prevent OpenVox from making changes (`noop`), and change logging verbosit
14
14
 
15
15
  ## Available Metaparameters
16
16
 
17
- }.dup
17
+ }.dup.strip + "\n"
18
18
  begin
19
19
  params = []
20
20
  Puppet::Type.eachmetaparam { |param|
@@ -443,8 +443,6 @@ class Puppet::Settings
443
443
  obj = @config[name.to_sym]
444
444
  if obj
445
445
  obj.desc
446
- else
447
- nil
448
446
  end
449
447
  end
450
448
 
@@ -77,8 +77,7 @@ module Puppet::Test
77
77
  # Call this method once, at the end of a test run, when no more tests
78
78
  # will be run.
79
79
  # @return nil
80
- def self.after_all_tests
81
- end
80
+ def self.after_all_tests; end
82
81
 
83
82
  # The name of the rollback mark used in the Puppet.context. This is what
84
83
  # the test infrastructure returns to for each test.
@@ -40,7 +40,6 @@ class Puppet::Transaction::Event
40
40
  source_description: nil,
41
41
  status: nil,
42
42
  tags: nil)
43
-
44
43
  @audited = audited
45
44
  @corrective_change = corrective_change
46
45
  @desired_value = desired_value
@@ -48,8 +48,6 @@ class Puppet::Transaction::Persistence
48
48
  !@old_data["resources"][resource_name]["parameters"].nil? &&
49
49
  !@old_data["resources"][resource_name]["parameters"][param_name].nil?
50
50
  @old_data["resources"][resource_name]["parameters"][param_name]["system_value"]
51
- else
52
- nil
53
51
  end
54
52
  end
55
53
 
@@ -87,8 +87,7 @@ Puppet::Type.newtype(:component) do
87
87
  # is no risk of this information leaking into reports, since no
88
88
  # Component instances survive the graph transmutation.
89
89
  #
90
- def set_sensitive_parameters(sensitive_parameters)
91
- end
90
+ def set_sensitive_parameters(sensitive_parameters); end
92
91
 
93
92
  private
94
93
 
@@ -881,7 +881,7 @@ Puppet::Type.newtype(:file) do
881
881
  if self[:ensure] == :present
882
882
  return true unless stat
883
883
 
884
- return(stat.ftype == "file")
884
+ return stat.ftype == "file"
885
885
  end
886
886
 
887
887
  # If we've gotten here, then :ensure isn't set
@@ -1019,8 +1019,6 @@ Puppet::Type.newtype(:file) do
1019
1019
  stat_info = stat
1020
1020
  if stat_info
1021
1021
  stat_info.ftype.to_s
1022
- else
1023
- nil
1024
1022
  end
1025
1023
  end
1026
1024
 
@@ -64,8 +64,6 @@ Puppet::Type.newtype(:resources) do
64
64
  defaultto {
65
65
  if @resource[:name] == "user"
66
66
  @resource.class.system_users_max_uid
67
- else
68
- nil
69
67
  end
70
68
  }
71
69
  end
@@ -85,8 +85,6 @@ module Puppet
85
85
  defaultto do
86
86
  if @resource.managed?
87
87
  :present
88
- else
89
- nil
90
88
  end
91
89
  end
92
90
 
data/lib/puppet/type.rb CHANGED
@@ -659,8 +659,6 @@ class Type
659
659
  # Note that if this is a property, then the value is the "should" value,
660
660
  # not the current value.
661
661
  obj.value
662
- else
663
- nil
664
662
  end
665
663
  end
666
664
 
@@ -754,8 +752,6 @@ class Type
754
752
  prop = @parameters[name.intern]
755
753
  if prop && prop.is_a?(Puppet::Property)
756
754
  prop.should
757
- else
758
- nil
759
755
  end
760
756
  end
761
757
 
@@ -833,8 +829,6 @@ class Type
833
829
  obj = @parameters[name.intern]
834
830
  if obj && obj.is_a?(Puppet::Property)
835
831
  obj
836
- else
837
- nil
838
832
  end
839
833
  end
840
834
 
@@ -902,8 +896,6 @@ class Type
902
896
  obj = @parameters[name]
903
897
  if obj && obj.respond_to?(:value)
904
898
  obj.value
905
- else
906
- nil
907
899
  end
908
900
  end
909
901
 
@@ -1023,8 +1015,7 @@ class Type
1023
1015
  # @return [void]
1024
1016
  # @abstract a resource type may implement this method to perform
1025
1017
  # validation checks that can query the complete catalog
1026
- def pre_run_check
1027
- end
1018
+ def pre_run_check; end
1028
1019
 
1029
1020
  # Flushes the provider if supported by the provider, else no action.
1030
1021
  # This is called by the transaction.
@@ -2197,8 +2188,8 @@ class Type
2197
2188
  # @return [void]
2198
2189
  def self.initvars
2199
2190
  # all of the instances of this class
2200
- @objects = Hash.new
2201
- @aliases = Hash.new
2191
+ @objects = {}
2192
+ @aliases = {}
2202
2193
 
2203
2194
  @defaults = {}
2204
2195
 
@@ -2511,8 +2502,6 @@ class Type
2511
2502
  parents = catalog.adjacent(self, :direction => :in)
2512
2503
  @parent = if parents
2513
2504
  parents.shift
2514
- else
2515
- nil
2516
2505
  end
2517
2506
  end
2518
2507
 
@@ -2605,7 +2594,7 @@ class Type
2605
2594
  end
2606
2595
 
2607
2596
  # @return [Boolean] Returns whether the resource is virtual or not
2608
- def virtual?; !!@virtual; end
2597
+ def virtual?; !!@virtual; end
2609
2598
  # @return [Boolean] Returns whether the resource is exported or not
2610
2599
  def exported?; !!@exported; end
2611
2600
 
@@ -8,13 +8,10 @@ class Puppet::Util::AtFork::Noop
8
8
  self
9
9
  end
10
10
 
11
- def prepare
12
- end
11
+ def prepare; end
13
12
 
14
- def parent
15
- end
13
+ def parent; end
16
14
 
17
- def child
18
- end
15
+ def child; end
19
16
  end
20
17
  end
@@ -154,8 +154,6 @@ module Puppet::Util::FileParsing
154
154
  record = record_type(type)
155
155
  if record
156
156
  record.fields.dup
157
- else
158
- nil
159
157
  end
160
158
  end
161
159
 
@@ -196,8 +194,6 @@ module Puppet::Util::FileParsing
196
194
  ret[field] = value
197
195
  end
198
196
  end
199
- else
200
- nil
201
197
  end
202
198
  else
203
199
  ret = {}
@@ -229,8 +225,6 @@ module Puppet::Util::FileParsing
229
225
  if ret
230
226
  ret[:record_type] = record.name
231
227
  ret
232
- else
233
- nil
234
228
  end
235
229
  end
236
230
 
@@ -109,8 +109,6 @@ class Puppet::Util::FileType
109
109
  # this code path is used by many callers so the original default is
110
110
  # being explicitly preserved
111
111
  Puppet::FileSystem.read(@path, :encoding => Encoding.default_external)
112
- else
113
- nil
114
112
  end
115
113
  end
116
114