Skip to content

Commit a0f5ebd

Browse files
committed
Make ensure => absent work again
The incremental update change made NS record updates work for non-glue NS records, but broke `ensure => absent` because there is no semantic guarantee that the contents of the `data` member match what's in DNS. Set math ensures that hilarity ensues.
1 parent 7555cdd commit a0f5ebd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/puppet_bind/provider/nsupdate.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ def maybe_unquote(type, datum)
8383
end
8484

8585
def rrdata_adds
86-
newdata - rrdata
86+
resource[:ensure] === :absent ? [] : newdata - rrdata
8787
end
8888

8989
def rrdata_deletes
90-
type === 'SOA' ? [] : rrdata - newdata
90+
resource[:ensure] === :absent ? rrdata : (type === 'SOA' ? [] : rrdata - newdata)
9191
end
9292

9393
def server

0 commit comments

Comments
 (0)