Skip to content

Commit

Permalink
Validate is over-complicating things, not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
fatmcgav committed Mar 6, 2015
1 parent 05e0dfb commit 2c49081
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions lib/puppet/type/resourceref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@
end
end


# Validate that we're not using the same target as resource
validate do
@resource.catalog.resources.select { |res|
# Skip resource if we're not interested in it...
next unless referenceable_resources.include?(res.type)

# Match on resource name...
raise Puppet::Error, 'Referenced resource has matching target.' if res[:name] == self[:name] and res[:target] == self[:target]
}
end

# Autorequire the user running command
autorequire(:user) do
self[:user]
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/type/resourceref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
)
end

# Need to stub jdbcresource type and provider.
# Need to stub jdbcresource provider.
let :jdbcresourceprovider do
Puppet::Type.type(:jdbcresource).provide(:fake_jdbcresource_provider) { mk_resource_methods }
end
Expand Down

0 comments on commit 2c49081

Please sign in to comment.