Skip to content

Commit

Permalink
Update the DNS key and zone signing methods to the new key names.
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Paterson <[email protected]>
  • Loading branch information
Stuart Paterson committed Nov 22, 2018
1 parent acaf26c commit 406969e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libraries/google_dns_managed_zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def initialize(opts = {})
catch_gcp_errors do
@managed_zone = @gcp.gcp_client(Google::Apis::DnsV2beta1::DnsService).get_managed_zone(opts[:project], opts[:zone])
create_resource_methods(@managed_zone)
@key_specs={}
@key_specs = {}
if defined?(@managed_zone.dnssec_config.default_key_specs) && !@managed_zone.dnssec_config.default_key_specs.nil?
@managed_zone.dnssec_config.default_key_specs.each do |spec|
@key_specs[spec.key_type]=spec.algorithm
@key_specs[spec.key_type] = spec.algorithm
end
end
end
Expand All @@ -39,13 +39,13 @@ def creation_time_date
end

def key_signing_key_algorithm
raise Inspec::Exceptions::ResourceFailed, "google_dns_managed_zone is missing expected property 'dnssec_config.default_key_specs'" if !@key_specs.key?('keySigning')
@key_specs['keySigning']
raise Inspec::Exceptions::ResourceFailed, "google_dns_managed_zone is missing expected property 'dnssec_config.default_key_specs KEY_SIGNING'" if !@key_specs.key?('KEY_SIGNING')
@key_specs['KEY_SIGNING']
end

def zone_signing_key_algorithm
raise Inspec::Exceptions::ResourceFailed, "google_dns_managed_zone is missing expected property 'dnssec_config.default_key_specs'" if !@key_specs.key?('zoneSigning')
@key_specs['zoneSigning']
raise Inspec::Exceptions::ResourceFailed, "google_dns_managed_zone is missing expected property 'dnssec_config.default_key_specs ZONE_SIGNING'" if !@key_specs.key?('ZONE_SIGNING')
@key_specs['ZONE_SIGNING']
end

def to_s
Expand Down

0 comments on commit 406969e

Please sign in to comment.