puppet-bind/lib/puppet/provider/resource_record/nsupdate.rb
Nate Riffe 7555cdd4e0 Fix type handling
Both the guts of the PuppetBind::Provider::Nsupdate module and the type method
of the dns_rr(nsupdate) provider produce and expect the type expressed as a
string, but the resource_record(nsupdate) provider's type method produces
symbols. This accidentally worked for a while, then it didn't. Also, in
quoted_type? that's supposed to be an array of strings, not a quoted string.
2015-05-21 14:24:35 -05:00

45 lines
598 B
Ruby

require 'puppet_bind/provider/nsupdate'
Puppet::Type.type(:resource_record).provide(:nsupdate) do
include PuppetBind::Provider::NsUpdate
commands :dig => 'dig', :nsupdate => 'nsupdate'
def initialize(value={})
super(value)
@properties = {}
end
def data
query.map { |record| record[:rrdata] }.sort
end
def data=(data)
@properties[:rrdata] = data
end
private
def rrdata
data
end
def newdata
resource[:data]
end
def rrclass
resource[:rrclass]
end
def type
resource[:type].to_s
end
def name
resource[:record]
end
end