vendored/puppet/lib/puppet/provider.rb in bolt-0.15.0 vs vendored/puppet/lib/puppet/provider.rb in bolt-0.16.0
- old
+ new
@@ -141,11 +141,11 @@
if defined?(@commands) and command = @commands[name]
# nothing
elsif superclass.respond_to? :command and command = superclass.command(name)
# nothing
else
- raise Puppet::DevError, "No command #{name} defined for provider #{self.name}"
+ raise Puppet::DevError, _("No command %{command} defined for provider %{provider}") % { command: name, provider: self.name }
end
which(command)
end
@@ -382,11 +382,11 @@
# @return [Array<Puppet::Provider>] a list of providers referencing the system entities
# @abstract this method must be implemented by a subclass and this super method should never be called as it raises an exception.
# @raise [Puppet::DevError] Error indicating that the method should have been implemented by subclass.
# @see prefetch
def self.instances
- raise Puppet::DevError, "Provider #{self.name} has not defined the 'instances' class method"
+ raise Puppet::DevError, _("Provider %{provider} has not defined the 'instances' class method") % { provider: self.name }
end
# Creates getter- and setter- methods for each property supported by the resource type.
# Call this method to generate simple accessors for all properties supported by the
# resource type. These simple accessors lookup and sets values in the property hash.
@@ -454,11 +454,11 @@
def self.supports_parameter?(param)
if param.is_a?(Class)
klass = param
else
unless klass = resource_type.attrclass(param)
- raise Puppet::DevError, "'#{param}' is not a valid parameter for #{resource_type.name}"
+ raise Puppet::DevError, _("'%{parameter_name}' is not a valid parameter for %{resource_type}") % { parameter_name: param, resource_type: resource_type.name }
end
end
return true unless features = klass.required_features
!!satisfies?(*features)
@@ -538,10 +538,10 @@
if n = @property_hash[:name]
return n
elsif self.resource
resource.name
else
- raise Puppet::DevError, "No resource and no name in property hash in #{self.class.name} instance"
+ raise Puppet::DevError, _("No resource and no name in property hash in %{class_name} instance") % { class_name: self.class.name }
end
end
# Sets the given parameters values as the current values for those parameters.
# Other parameters are unchanged.