Skip to content

Commit

Permalink
Add missing return
Browse files Browse the repository at this point in the history
rubocop 1.65.0 fixed false negatives for Lint/Void, which highlighted
some bugs where the guard clauses weren't doing anything.

Commit 01db61e moved code from runtime3_support to runtime3_resource_support:

    * Runtime3Support is modified to use Runtime3ResourceSupport instead of
      directly containing the methods for resource search and creation.

But the resource_to_ptype method was copied instead of moved. So delete
it from Runtime3Support.
  • Loading branch information
joshcooper committed Jul 11, 2024
1 parent 7739378 commit 214206f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
3 changes: 2 additions & 1 deletion lib/puppet/pops/evaluator/runtime3_resource_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def self.find_resource_type_or_class(scope, name)
end

def self.resource_to_ptype(resource)
nil if resource.nil?
return nil if resource.nil?

# inference returns the meta type since the 3x Resource is an alternate way to describe a type
Puppet::Pops::Types::TypeCalculator.singleton().infer(resource).type
end
Expand Down
6 changes: 0 additions & 6 deletions lib/puppet/pops/evaluator/runtime3_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,6 @@ def is_parameter_of_resource?(scope, resource, name)
resource.valid_parameter?(name)
end

def resource_to_ptype(resource)
nil if resource.nil?
# inference returns the meta type since the 3x Resource is an alternate way to describe a type
type_calculator.infer(resource).type
end

# This is the same type of "truth" as used in the current Puppet DSL.
#
def is_true?(value, o)
Expand Down
11 changes: 6 additions & 5 deletions lib/puppet/provider/package/pkgutil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ def self.parse_pkglist(output, hash = {})

# Identify common types of pkgutil noise as it downloads catalogs etc
def self.noise?(line)
true if line =~ /^#/
true if line =~ /^Checking integrity / # use_gpg
true if line =~ /^gpg: / # gpg verification
true if line =~ /^=+> / # catalog fetch
true if line =~ /\d+:\d+:\d+ URL:/ # wget without -q
return true if line =~ /^#/
return true if line =~ /^Checking integrity / # use_gpg
return true if line =~ /^gpg: / # gpg verification
return true if line =~ /^=+> / # catalog fetch
return true if line =~ /\d+:\d+:\d+ URL:/ # wget without -q

false
end

Expand Down

0 comments on commit 214206f

Please sign in to comment.