Class: Roadworker::Batch::Delete
- Defined in:
- lib/roadworker/batch.rb
Instance Attribute Summary
Attributes inherited from Operation
#dry_run, #health_checks, #hosted_zone, #logger, #rrset
Instance Method Summary collapse
- #changes ⇒ Object
-
#cname_first? ⇒ Boolean
CNAME should always be deleted first, as CNAME doesn’t permit other records.
- #diff! ⇒ Object
- #hosted_zone_soa_or_ns? ⇒ Boolean
Methods inherited from Operation
#desired_rrset, #initialize, #inspect, #op_size, #present_rrset, #sort_key, #to_s, #value_size
Methods included from Log
Constructor Details
This class inherits a constructor from Roadworker::Batch::Operation
Instance Method Details
#changes ⇒ Object
278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/roadworker/batch.rb', line 278 def changes # Avoid deleting hosted zone SOA/NS if hosted_zone_soa_or_ns? return [] end [ { action: 'DELETE', resource_record_set: present_rrset.to_h, } ] end |
#cname_first? ⇒ Boolean
CNAME should always be deleted first, as CNAME doesn’t permit other records
270 271 272 |
# File 'lib/roadworker/batch.rb', line 270 def cname_first? true end |
#diff! ⇒ Object
292 293 294 295 296 297 |
# File 'lib/roadworker/batch.rb', line 292 def diff! return if changes.empty? log(:info, 'Delete ResourceRecordSet', :red) do "#{present_rrset.name} #{present_rrset.type}#{ present_rrset.set_identifier && " (#{present_rrset.set_identifier})" }" end end |
#hosted_zone_soa_or_ns? ⇒ Boolean
274 275 276 |
# File 'lib/roadworker/batch.rb', line 274 def hosted_zone_soa_or_ns? (present_rrset.type == 'SOA' || present_rrset.type == 'NS') && hosted_zone.name == present_rrset.name end |