From 0c5395b0d6f91712caa54cd9d129d1b2c785ffce Mon Sep 17 00:00:00 2001 From: Paul Thornthwaite Date: Sat, 22 Dec 2012 23:27:58 +0000 Subject: [PATCH] [dynect|dns] Updates reference to service --- lib/fog/dynect/models/dns/record.rb | 6 +++--- lib/fog/dynect/models/dns/records.rb | 4 ++-- lib/fog/dynect/models/dns/zone.rb | 8 ++++---- lib/fog/dynect/models/dns/zones.rb | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/fog/dynect/models/dns/record.rb b/lib/fog/dynect/models/dns/record.rb index 9be7eeaea..7c3d42089 100644 --- a/lib/fog/dynect/models/dns/record.rb +++ b/lib/fog/dynect/models/dns/record.rb @@ -16,7 +16,7 @@ module Fog def destroy requires :identity, :name, :type, :zone - connection.delete_record(type, zone.identity, name, identity) + service.delete_record(type, zone.identity, name, identity) true end @@ -28,13 +28,13 @@ module Fog } options.delete_if {|key, value| value.nil?} - data = connection.post_record(type, zone.identity, name, rdata, options).body['data'] + data = service.post_record(type, zone.identity, name, rdata, options).body['data'] # avoid overwriting zone object with zone string data = data.reject {|key, value| key == 'zone'} merge_attributes(data) zone.publish - records = connection.get_record(type, zone.identity, name).body['data'] + records = service.get_record(type, zone.identity, name).body['data'] # data in format ['/REST/xRecord/domain/fqdn/identity] records.map! do |record| tokens = record.split('/') diff --git a/lib/fog/dynect/models/dns/records.rb b/lib/fog/dynect/models/dns/records.rb index bab003f24..12122e61f 100644 --- a/lib/fog/dynect/models/dns/records.rb +++ b/lib/fog/dynect/models/dns/records.rb @@ -14,8 +14,8 @@ module Fog def all(options = {}) requires :zone data = [] - connection.get_node_list(zone.domain, options).body['data'].each do |fqdn| - records = connection.get_record('ANY', zone.domain, fqdn).body['data'] + service.get_node_list(zone.domain, options).body['data'].each do |fqdn| + records = service.get_record('ANY', zone.domain, fqdn).body['data'] # data in format ['/REST/xRecord/domain/fqdn/identity] records.map! do |record| diff --git a/lib/fog/dynect/models/dns/zone.rb b/lib/fog/dynect/models/dns/zone.rb index e75316ade..d4dc3c386 100644 --- a/lib/fog/dynect/models/dns/zone.rb +++ b/lib/fog/dynect/models/dns/zone.rb @@ -23,7 +23,7 @@ module Fog def destroy requires :domain - connection.delete_zone(domain) + service.delete_zone(domain) true end @@ -34,12 +34,12 @@ module Fog def publish requires :identity - data = connection.put_zone(identity, 'publish' => true) + data = service.put_zone(identity, 'publish' => true) true end def records - @records ||= Fog::DNS::Dynect::Records.new(:zone => self, :connection => connection) + @records ||= Fog::DNS::Dynect::Records.new(:zone => self, :service => service) end def nameservers @@ -48,7 +48,7 @@ module Fog def save requires :domain, :email, :ttl - data = connection.post_zone(email, ttl, domain).body['data'] + data = service.post_zone(email, ttl, domain).body['data'] merge_attributes(data) true end diff --git a/lib/fog/dynect/models/dns/zones.rb b/lib/fog/dynect/models/dns/zones.rb index c864af3fd..d3c33555f 100644 --- a/lib/fog/dynect/models/dns/zones.rb +++ b/lib/fog/dynect/models/dns/zones.rb @@ -10,14 +10,14 @@ module Fog model Fog::DNS::Dynect::Zone def all - data = connection.get_zone.body['data'].map do |zone| + data = service.get_zone.body['data'].map do |zone| { :domain => zone } end load(data) end def get(zone_id) - new(connection.get_zone('zone' => zone_id).body['data']) + new(service.get_zone('zone' => zone_id).body['data']) rescue Excon::Errors::NotFound nil end