From b98428b08b47f3191704df5603f4d30412fe936a Mon Sep 17 00:00:00 2001 From: Paul Thornthwaite Date: Sat, 22 Dec 2012 23:29:33 +0000 Subject: [PATCH] [bluebox] Updates reference to service --- lib/fog/bluebox/models/compute/flavors.rb | 4 ++-- lib/fog/bluebox/models/compute/image.rb | 16 ++++++++-------- lib/fog/bluebox/models/compute/images.rb | 4 ++-- lib/fog/bluebox/models/compute/locations.rb | 4 ++-- lib/fog/bluebox/models/compute/server.rb | 16 ++++++++-------- lib/fog/bluebox/models/compute/servers.rb | 4 ++-- lib/fog/bluebox/models/dns/record.rb | 6 +++--- lib/fog/bluebox/models/dns/records.rb | 4 ++-- lib/fog/bluebox/models/dns/zone.rb | 6 +++--- lib/fog/bluebox/models/dns/zones.rb | 4 ++-- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/fog/bluebox/models/compute/flavors.rb b/lib/fog/bluebox/models/compute/flavors.rb index 59a8ed7ac..7ce0df18f 100644 --- a/lib/fog/bluebox/models/compute/flavors.rb +++ b/lib/fog/bluebox/models/compute/flavors.rb @@ -10,12 +10,12 @@ module Fog model Fog::Compute::Bluebox::Flavor def all - data = connection.get_products.body + data = service.get_products.body load(data) end def get(product_id) - response = connection.get_product(product_id) + response = service.get_product(product_id) new(response.body) rescue Fog::Compute::Bluebox::NotFound nil diff --git a/lib/fog/bluebox/models/compute/image.rb b/lib/fog/bluebox/models/compute/image.rb index f3af4709e..660867958 100644 --- a/lib/fog/bluebox/models/compute/image.rb +++ b/lib/fog/bluebox/models/compute/image.rb @@ -7,26 +7,26 @@ module Fog class Image < Fog::Model identity :id - + attribute :block_id attribute :description attribute :public attribute :created_at, :aliases => 'created' - + def save requires :block_id - - data = connection.create_template(block_id, attributes) + + data = service.create_template(block_id, attributes) true end - + def destroy requires :id - - data = connection.destroy_template(id) + + data = service.destroy_template(id) true end - + end end diff --git a/lib/fog/bluebox/models/compute/images.rb b/lib/fog/bluebox/models/compute/images.rb index be622a610..0f563dbf5 100644 --- a/lib/fog/bluebox/models/compute/images.rb +++ b/lib/fog/bluebox/models/compute/images.rb @@ -10,12 +10,12 @@ module Fog model Fog::Compute::Bluebox::Image def all - data = connection.get_templates.body + data = service.get_templates.body load(data) end def get(template_id) - response = connection.get_template(template_id) + response = service.get_template(template_id) new(response.body) rescue Fog::Compute::Bluebox::NotFound nil diff --git a/lib/fog/bluebox/models/compute/locations.rb b/lib/fog/bluebox/models/compute/locations.rb index d03118802..ecbb56f1d 100644 --- a/lib/fog/bluebox/models/compute/locations.rb +++ b/lib/fog/bluebox/models/compute/locations.rb @@ -10,12 +10,12 @@ module Fog model Fog::Compute::Bluebox::Location def all - data = connection.get_locations.body + data = service.get_locations.body load(data) end def get(location_id) - response = connection.get_location(location_id) + response = service.get_location(location_id) new(response.body) rescue Fog::Compute::Bluebox::NotFound nil diff --git a/lib/fog/bluebox/models/compute/server.rb b/lib/fog/bluebox/models/compute/server.rb index 145a58c9e..523706687 100644 --- a/lib/fog/bluebox/models/compute/server.rb +++ b/lib/fog/bluebox/models/compute/server.rb @@ -33,23 +33,23 @@ module Fog def destroy requires :id - connection.destroy_block(id) + service.destroy_block(id) true end def flavor requires :flavor_id - connection.flavors.get(flavor_id) + service.flavors.get(flavor_id) end def image requires :image_id - connection.images.get(image_id) + service.images.get(image_id) end - + def location requires :location_id - connection.locations.get(location_id) + service.locations.get(location_id) end def private_ip_address @@ -66,7 +66,7 @@ module Fog def reboot(type = 'SOFT') requires :id - connection.reboot_block(id, type) + service.reboot_block(id, type) true end @@ -88,10 +88,10 @@ module Fog elsif @lb_applications options['lb_applications'] = lb_applications end - + options['username'] = username options['hostname'] = hostname if @hostname - data = connection.create_block(flavor_id, image_id, location_id, options) + data = service.create_block(flavor_id, image_id, location_id, options) merge_attributes(data.body) true end diff --git a/lib/fog/bluebox/models/compute/servers.rb b/lib/fog/bluebox/models/compute/servers.rb index 55a56e636..360d8a779 100644 --- a/lib/fog/bluebox/models/compute/servers.rb +++ b/lib/fog/bluebox/models/compute/servers.rb @@ -10,7 +10,7 @@ module Fog model Fog::Compute::Bluebox::Server def all - data = connection.get_blocks.body + data = service.get_blocks.body load(data) end @@ -22,7 +22,7 @@ module Fog end def get(server_id) - if server_id && server = connection.get_block(server_id).body + if server_id && server = service.get_block(server_id).body new(server) end rescue Fog::Compute::Bluebox::NotFound diff --git a/lib/fog/bluebox/models/dns/record.rb b/lib/fog/bluebox/models/dns/record.rb index 4156f8cf5..09fb66416 100644 --- a/lib/fog/bluebox/models/dns/record.rb +++ b/lib/fog/bluebox/models/dns/record.rb @@ -23,7 +23,7 @@ module Fog def destroy requires :identity - connection.delete_record(@zone.identity, identity) + service.delete_record(@zone.identity, identity) true end @@ -34,9 +34,9 @@ module Fog def save requires :zone, :type, :name, :value data = unless identity - connection.create_record(zone.identity, type, name, value) + service.create_record(zone.identity, type, name, value) else - connection.update_record(zone.identity, identity, {:type => type, :name => name, :content => value}) + service.update_record(zone.identity, identity, {:type => type, :name => name, :content => value}) end merge_attributes(data.body) true diff --git a/lib/fog/bluebox/models/dns/records.rb b/lib/fog/bluebox/models/dns/records.rb index eb7fd2493..bf8f1a2e6 100644 --- a/lib/fog/bluebox/models/dns/records.rb +++ b/lib/fog/bluebox/models/dns/records.rb @@ -13,12 +13,12 @@ module Fog def all requires :zone - data = connection.get_records(zone.identity).body['records'] + data = service.get_records(zone.identity).body['records'] load(data) end def get(record_id) - data = connection.get_record(zone.identity, record_id).body + data = service.get_record(zone.identity, record_id).body new(data) rescue Fog::Service::NotFound nil diff --git a/lib/fog/bluebox/models/dns/zone.rb b/lib/fog/bluebox/models/dns/zone.rb index f081e8c44..a7c6d211f 100644 --- a/lib/fog/bluebox/models/dns/zone.rb +++ b/lib/fog/bluebox/models/dns/zone.rb @@ -31,7 +31,7 @@ module Fog @records ||= begin Fog::DNS::Bluebox::Records.new( :zone => self, - :connection => connection + :service => service ) end end @@ -46,7 +46,7 @@ module Fog def destroy requires :identity - connection.delete_zone(identity) + service.delete_zone(identity) true end @@ -54,7 +54,7 @@ module Fog requires :domain, :ttl options = attributes.dup options[:name] = options.delete(:domain) - data = identity.nil? ? connection.create_zone(options) : connection.update_zone(identity, options) + data = identity.nil? ? service.create_zone(options) : service.update_zone(identity, options) merge_attributes(data.body) true end diff --git a/lib/fog/bluebox/models/dns/zones.rb b/lib/fog/bluebox/models/dns/zones.rb index dfb2f7fcd..b82535500 100644 --- a/lib/fog/bluebox/models/dns/zones.rb +++ b/lib/fog/bluebox/models/dns/zones.rb @@ -10,12 +10,12 @@ module Fog model Fog::DNS::Bluebox::Zone def all - data = connection.get_zones.body['zones'] + data = service.get_zones.body['zones'] load(data) end def get(zone_id) - data = connection.get_zone(zone_id).body + data = service.get_zone(zone_id).body new(data) rescue Fog::Service::NotFound nil