lib/fog/azurerm/requests/dns/check_for_zone.rb in fog-azure-rm-0.0.2 vs lib/fog/azurerm/requests/dns/check_for_zone.rb in fog-azure-rm-0.0.3
- old
+ new
@@ -9,15 +9,16 @@
token = Fog::Credentials::AzureRM.get_token(@tenant_id, @client_id, @client_secret)
RestClient.get(
resource_url,
accept: 'application/json',
content_type: 'application/json',
- authorization: token)
+ authorization: token
+ )
true
rescue RestClient::Exception => e
body = JSON.parse(e.response)
- if(body['error']['code']) == 'ResourceNotFound'
+ if (body['error']['code']) == 'ResourceNotFound'
false
else
Fog::Logger.warning "Exception checking if the zone exists in resource group #{resource_group}"
msg = "Exception checking if the zone exists: #{body['error']['code']}, #{body['error']['message']}"
raise msg
@@ -26,12 +27,12 @@
end
end
# Mock class for DNS Request
class Mock
- def check_for_zone(_resource_group, _name)
- Fog::Logger.debug "Zone name #{_name} is available."
- return true
+ def check_for_zone(_resource_group, name)
+ Fog::Logger.debug "Zone name #{name} is available."
+ true
end
end
end
end
end