Skip to content

Commit 4122f08

Browse files
committed
(maint) lift duplicate assignment
1 parent 1341033 commit 4122f08

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/puppet/resource_api/type_definition.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ def validate_schema(definition, attr_key)
3939
supported_features = %w[supports_noop canonicalize remote_resource simple_get_filter].freeze
4040
unknown_features = definition[:features] - supported_features
4141
Puppet.warning("Unknown feature detected: #{unknown_features.inspect}") unless unknown_features.empty?
42-
43-
# store the validated definition
44-
@definition = definition
4542
end
4643
end
4744

@@ -75,10 +72,12 @@ class BaseTypeDefinition
7572
def initialize(definition, attr_key)
7673
@data_type_cache = {}
7774
validate_schema(definition, attr_key)
75+
# store the validated definition
76+
@definition = definition
7877
end
7978

8079
def name
81-
@definition[:name]
80+
definition[:name]
8281
end
8382

8483
def namevars
@@ -118,8 +117,6 @@ def validate_schema(definition, attr_key)
118117
attr[:behaviour] = attr[:behavior]
119118
attr.delete(:behavior)
120119
end
121-
# store the validated definition
122-
@definition = definition
123120
end
124121

125122
# validates a resource hash against its type schema

0 commit comments

Comments
 (0)