diff --git a/lib/fog/aws/compute.rb b/lib/fog/aws/compute.rb index be7e25a2d..9af866fe9 100644 --- a/lib/fog/aws/compute.rb +++ b/lib/fog/aws/compute.rb @@ -93,7 +93,7 @@ module Fog class Real def modify_image_attributes(*params) - Formatador.display_line("[yellow][WARN] modify_image_attributes is deprecated, use modify_image_attribute instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("modify_image_attributes is deprecated, use modify_image_attribute instead [light_black](#{caller.first})[/]") modify_image_attribute(*params) end diff --git a/lib/fog/aws/models/compute/addresses.rb b/lib/fog/aws/models/compute/addresses.rb index 8998d7499..d50b50fe5 100644 --- a/lib/fog/aws/models/compute/addresses.rb +++ b/lib/fog/aws/models/compute/addresses.rb @@ -56,7 +56,7 @@ module Fog def all(filters = filters) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('public-ip' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('public-ip' => []) instead [light_black](#{caller.first})[/]") filters = {'public-ip' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/compute/key_pairs.rb b/lib/fog/aws/models/compute/key_pairs.rb index ac83366b7..e60350138 100644 --- a/lib/fog/aws/models/compute/key_pairs.rb +++ b/lib/fog/aws/models/compute/key_pairs.rb @@ -51,7 +51,7 @@ module Fog def all(filters = filters) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('key-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('key-name' => []) instead [light_black](#{caller.first})[/]") filters = {'key-name' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/compute/security_groups.rb b/lib/fog/aws/models/compute/security_groups.rb index f2ecde37d..32ae5b98a 100644 --- a/lib/fog/aws/models/compute/security_groups.rb +++ b/lib/fog/aws/models/compute/security_groups.rb @@ -57,7 +57,7 @@ module Fog def all(filters = filters) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('group-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('group-name' => []) instead [light_black](#{caller.first})[/]") filters = {'group-name' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/compute/servers.rb b/lib/fog/aws/models/compute/servers.rb index f6c8fcc43..0c9c30f46 100644 --- a/lib/fog/aws/models/compute/servers.rb +++ b/lib/fog/aws/models/compute/servers.rb @@ -57,7 +57,7 @@ module Fog def all(filters = self.filters) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('instance-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('instance-id' => []) instead [light_black](#{caller.first})[/]") filters = {'instance-id' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/compute/snapshots.rb b/lib/fog/aws/models/compute/snapshots.rb index d136401c3..04cd696ad 100644 --- a/lib/fog/aws/models/compute/snapshots.rb +++ b/lib/fog/aws/models/compute/snapshots.rb @@ -19,7 +19,7 @@ module Fog def all(filters = filters, options = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('snapshot-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('snapshot-id' => []) instead [light_black](#{caller.first})[/]") filters = {'snapshot-id' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/compute/spot_requests.rb b/lib/fog/aws/models/compute/spot_requests.rb index fa2181fbd..61128d22a 100644 --- a/lib/fog/aws/models/compute/spot_requests.rb +++ b/lib/fog/aws/models/compute/spot_requests.rb @@ -17,7 +17,7 @@ module Fog def all(filters = self.filters) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('spot-instance-request-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('spot-instance-request-id' => []) instead [light_black](#{caller.first})[/]") filters = {'spot-instance-request-id' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/compute/volumes.rb b/lib/fog/aws/models/compute/volumes.rb index 263c265c4..cf7594d76 100644 --- a/lib/fog/aws/models/compute/volumes.rb +++ b/lib/fog/aws/models/compute/volumes.rb @@ -64,7 +64,7 @@ module Fog def all(filters = filters) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] all with #{filters.class} param is deprecated, use all('volume-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("all with #{filters.class} param is deprecated, use all('volume-id' => []) instead [light_black](#{caller.first})[/]") filters = {'volume-id' => [*filters]} end self.filters = filters diff --git a/lib/fog/aws/models/storage/file.rb b/lib/fog/aws/models/storage/file.rb index 845ec7bbd..b5ba0d362 100644 --- a/lib/fog/aws/models/storage/file.rb +++ b/lib/fog/aws/models/storage/file.rb @@ -104,7 +104,7 @@ module Fog def save(options = {}) requires :body, :directory, :key if options != {} - Formatador.display_line("[yellow][WARN] options param is deprecated, use acl= instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("options param is deprecated, use acl= instead [light_black](#{caller.first})[/]") end options['x-amz-acl'] ||= @acl if @acl options['Cache-Control'] = cache_control if cache_control diff --git a/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb b/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb index a43f047b4..7b0d03a13 100644 --- a/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +++ b/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb @@ -28,10 +28,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-AuthorizeSecurityGroupIngress.html] def authorize_security_group_ingress(group_name, options = {}) if group_name.is_a?(Hash) - location = caller.first - warning = "[yellow][WARN] Fog::AWS::Compute#authorize_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated" - warning << " [light_black](" << location << ")[/] " - Formatador.display_line(warning) + Fog::Logger.warning("Fog::AWS::Compute#authorize_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated [light_black](#{caller.first})[/]") options = group_name group_name = options['GroupName'] end @@ -49,10 +46,7 @@ module Fog def authorize_security_group_ingress(group_name, options = {}) if group_name.is_a?(Hash) - location = caller.first - warning = "[yellow][WARN] Fog::AWS::Compute#authorize_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated" - warning << " [light_black](" << location << ")[/] " - Formatador.display_line(warning) + Fog::Logger.warning("Fog::AWS::Compute#authorize_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated [light_black](#{caller.first})[/]") options = group_name group_name = options['GroupName'] end diff --git a/lib/fog/aws/requests/compute/describe_addresses.rb b/lib/fog/aws/requests/compute/describe_addresses.rb index b136d088d..266cb749a 100644 --- a/lib/fog/aws/requests/compute/describe_addresses.rb +++ b/lib/fog/aws/requests/compute/describe_addresses.rb @@ -21,7 +21,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAddresses.html] def describe_addresses(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_addresses with #{filters.class} param is deprecated, use describe_addresses('public-ip' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_addresses with #{filters.class} param is deprecated, use describe_addresses('public-ip' => []) instead [light_black](#{caller.first})[/]") filters = {'public-ip' => [*filters]} end params = Fog::AWS.indexed_filters(filters) @@ -38,7 +38,7 @@ module Fog def describe_addresses(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_addresses with #{filters.class} param is deprecated, use describe_addresses('public-ip' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_addresses with #{filters.class} param is deprecated, use describe_addresses('public-ip' => []) instead [light_black](#{caller.first})[/]") filters = {'public-ip' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/describe_availability_zones.rb b/lib/fog/aws/requests/compute/describe_availability_zones.rb index 760e4e9d9..6ea9339f3 100644 --- a/lib/fog/aws/requests/compute/describe_availability_zones.rb +++ b/lib/fog/aws/requests/compute/describe_availability_zones.rb @@ -22,7 +22,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAvailabilityZones.html] def describe_availability_zones(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead [light_black](#{caller.first})[/]") filters = {'public-ip' => [*filters]} end params = Fog::AWS.indexed_filters(filters) @@ -39,7 +39,7 @@ module Fog def describe_availability_zones(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead [light_black](#{caller.first})[/]") filters = {'public-ip' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/describe_images.rb b/lib/fog/aws/requests/compute/describe_images.rb index 8da8fee09..7d770da3f 100644 --- a/lib/fog/aws/requests/compute/describe_images.rb +++ b/lib/fog/aws/requests/compute/describe_images.rb @@ -60,12 +60,12 @@ module Fog def describe_images(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_images with #{filters.class} param is deprecated, use describe_images('image-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_images with #{filters.class} param is deprecated, use describe_images('image-id' => []) instead [light_black](#{caller.first})[/]") filters = {'image-id' => [*filters]} end if filters.keys.any? {|key| key =~ /^block-device/} - Formatador.display_line("[yellow][WARN] describe_images block-device-mapping filters are not yet mocked[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_images block-device-mapping filters are not yet mocked [light_black](#{caller.first})[/]") Fog::Mock.not_implemented end diff --git a/lib/fog/aws/requests/compute/describe_instances.rb b/lib/fog/aws/requests/compute/describe_instances.rb index bea4f68b3..251317a13 100644 --- a/lib/fog/aws/requests/compute/describe_instances.rb +++ b/lib/fog/aws/requests/compute/describe_instances.rb @@ -54,7 +54,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html] def describe_instances(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead [light_black](#{caller.first})[/]") filters = {'instance-id' => [*filters]} end params = {} @@ -77,7 +77,7 @@ module Fog def describe_instances(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_instances with #{filters.class} param is deprecated, use describe_instances('instance-id' => []) instead [light_black](#{caller.first})[/]") filters = {'instance-id' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/describe_key_pairs.rb b/lib/fog/aws/requests/compute/describe_key_pairs.rb index 4708beb23..cdef398b7 100644 --- a/lib/fog/aws/requests/compute/describe_key_pairs.rb +++ b/lib/fog/aws/requests/compute/describe_key_pairs.rb @@ -21,7 +21,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeKeyPairs.html] def describe_key_pairs(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead [light_black](#{caller.first})[/]") filters = {'key-name' => [*filters]} end params = Fog::AWS.indexed_filters(filters) @@ -38,7 +38,7 @@ module Fog def describe_key_pairs(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_key_pairs with #{filters.class} param is deprecated, use describe_key_pairs('key-name' => []) instead [light_black](#{caller.first})[/]") filters = {'key-name' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/describe_regions.rb b/lib/fog/aws/requests/compute/describe_regions.rb index 93daf595c..4a8780d32 100644 --- a/lib/fog/aws/requests/compute/describe_regions.rb +++ b/lib/fog/aws/requests/compute/describe_regions.rb @@ -21,7 +21,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeRegions.html] def describe_regions(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead [light_black](#{caller.first})[/]") filters = {'region-name' => [*filters]} end params = Fog::AWS.indexed_filters(filters) @@ -38,7 +38,7 @@ module Fog def describe_regions(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_regions with #{filters.class} param is deprecated, use describe_regions('region-name' => []) instead [light_black](#{caller.first})[/]") filters = {'region-name' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/describe_reserved_instances.rb b/lib/fog/aws/requests/compute/describe_reserved_instances.rb index 723702f8a..2b913e2f3 100644 --- a/lib/fog/aws/requests/compute/describe_reserved_instances.rb +++ b/lib/fog/aws/requests/compute/describe_reserved_instances.rb @@ -29,7 +29,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstances.html] def describe_reserved_instances(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_reserved_instances with #{filters.class} param is deprecated, use describe_reserved_instances('reserved-instances-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_reserved_instances with #{filters.class} param is deprecated, use describe_reserved_instances('reserved-instances-id' => []) instead [light_black](#{caller.first})[/]") filters = {'reserved-instances-id' => [*filters]} end params = Fog::AWS.indexed_filters(filters) diff --git a/lib/fog/aws/requests/compute/describe_security_groups.rb b/lib/fog/aws/requests/compute/describe_security_groups.rb index b1c961f16..96cad2cfe 100644 --- a/lib/fog/aws/requests/compute/describe_security_groups.rb +++ b/lib/fog/aws/requests/compute/describe_security_groups.rb @@ -31,7 +31,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSecurityGroups.html] def describe_security_groups(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead [light_black](#{caller.first})[/]") filters = {'group-name' => [*filters]} end params = Fog::AWS.indexed_filters(filters) @@ -48,7 +48,7 @@ module Fog def describe_security_groups(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead [light_black](#{caller.first})[/]") filters = {'group-name' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/describe_snapshots.rb b/lib/fog/aws/requests/compute/describe_snapshots.rb index 9f383b7b6..0a8c9add5 100644 --- a/lib/fog/aws/requests/compute/describe_snapshots.rb +++ b/lib/fog/aws/requests/compute/describe_snapshots.rb @@ -27,11 +27,11 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html] def describe_snapshots(filters = {}, options = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead [light_black](#{caller.first})[/]") filters = {'snapshot-id' => [*filters]} end unless options.empty? - Formatador.display_line("[yellow][WARN] describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead [light_black](#{caller.first})[/]") end for key in ['ExecutableBy', 'ImageId', 'Owner', 'RestorableBy'] @@ -54,11 +54,11 @@ module Fog def describe_snapshots(filters = {}, options = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead [light_black](#{caller.first})[/]") filters = {'snapshot-id' => [*filters]} end unless options.empty? - Formatador.display_line("[yellow][WARN] describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead [light_black](#{caller.first})[/]") end response = Excon::Response.new @@ -66,10 +66,10 @@ module Fog snapshot_set = self.data[:snapshots].values if filters.delete('owner-alias') - Formatador.display_line("[yellow][WARN] describe_snapshots with owner-alias is not mocked[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_snapshots with owner-alias is not mocked [light_black](#{caller.first})[/]") end if (restorable_by = filters.delete('RestorableBy')) && restorable_by != 'self' - Formatador.display_line("[yellow][WARN] describe_snapshots with RestorableBy other than 'self' (wanted #{restorable_by.inspect}) is not mocked[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_snapshots with RestorableBy other than 'self' (wanted #{restorable_by.inspect}) is not mocked [light_black](#{caller.first})[/]") end snapshot_set = apply_tag_filters(snapshot_set, filters) diff --git a/lib/fog/aws/requests/compute/describe_volumes.rb b/lib/fog/aws/requests/compute/describe_volumes.rb index 75e12ede3..84083867e 100644 --- a/lib/fog/aws/requests/compute/describe_volumes.rb +++ b/lib/fog/aws/requests/compute/describe_volumes.rb @@ -31,7 +31,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVolumes.html] def describe_volumes(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_volumes with #{filters.class} param is deprecated, use describe_volumes('volume-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_volumes with #{filters.class} param is deprecated, use describe_volumes('volume-id' => []) instead [light_black](#{caller.first})[/]") filters = {'volume-id' => [*filters]} end params = Fog::AWS.indexed_filters(filters) @@ -48,7 +48,7 @@ module Fog def describe_volumes(filters = {}) unless filters.is_a?(Hash) - Formatador.display_line("[yellow][WARN] describe_volumes with #{filters.class} param is deprecated, use describe_volumes('volume-id' => []) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("describe_volumes with #{filters.class} param is deprecated, use describe_volumes('volume-id' => []) instead [light_black](#{caller.first})[/]") filters = {'volume-id' => [*filters]} end diff --git a/lib/fog/aws/requests/compute/modify_instance_attribute.rb b/lib/fog/aws/requests/compute/modify_instance_attribute.rb index 2c75fe03b..786af7331 100644 --- a/lib/fog/aws/requests/compute/modify_instance_attribute.rb +++ b/lib/fog/aws/requests/compute/modify_instance_attribute.rb @@ -32,9 +32,9 @@ module Fog :parser => Fog::Parsers::Compute::AWS::Basic.new }.merge!(params)) end - + def modify_instance_attributes(instance_id, attributes) - Formatador.display_line("[yellow][WARN] modify_instance_attributes method is deprecated, use 'modify_instance_attribute' instead[/]") + Fog::Logger.warning("modify_instance_attributes method is deprecated, use 'modify_instance_attribute' instead") modify_instance_attribute(instance_id, attributes) end diff --git a/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb b/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb index a2659b3f4..6bd02abb1 100644 --- a/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +++ b/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb @@ -27,10 +27,7 @@ module Fog # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-RevokeSecurityGroupIngress.html] def revoke_security_group_ingress(group_name, options = {}) if group_name.is_a?(Hash) - location = caller.first - warning = "[yellow][WARN] Fog::AWS::Compute#revoke_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated" - warning << " [light_black](" << location << ")[/] " - Formatador.display_line(warning) + Fog::Logger.warning("Fog::AWS::Compute#revoke_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated [light_black](#{caller.first})[/]") options = group_name group_name = options['GroupName'] end @@ -48,10 +45,7 @@ module Fog def revoke_security_group_ingress(group_name, options = {}) if group_name.is_a?(Hash) - location = caller.first - warning = "[yellow][WARN] Fog::AWS::Compute#revoke_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated" - warning << " [light_black](" << location << ")[/] " - Formatador.display_line(warning) + Fog::Logger.warning("Fog::AWS::Compute#revoke_security_group_ingress now requires the 'group_name' parameter. Only specifying an options hash is now deprecated [light_black](#{caller.first})[/]") options = group_name group_name = options['GroupName'] end diff --git a/lib/fog/aws/requests/simpledb/get_attributes.rb b/lib/fog/aws/requests/simpledb/get_attributes.rb index 5dbcc33a8..6607ad036 100644 --- a/lib/fog/aws/requests/simpledb/get_attributes.rb +++ b/lib/fog/aws/requests/simpledb/get_attributes.rb @@ -29,7 +29,7 @@ module Fog # * 'RequestId' def get_attributes(domain_name, item_name, options = {}) if options.is_a?(Array) - Formatador.display_line("[yellow][WARN] get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]") options = {'AttributeName' => options} end options['AttributeName'] ||= [] @@ -49,7 +49,7 @@ module Fog def get_attributes(domain_name, item_name, options = {}) if options.is_a?(Array) - Formatador.display_line("[yellow][WARN] get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]") options['AttributeName'] ||= options if options.is_a?(Array) end options['AttributeName'] ||= [] diff --git a/lib/fog/aws/requests/simpledb/select.rb b/lib/fog/aws/requests/simpledb/select.rb index 8eef15a3d..226bd1891 100644 --- a/lib/fog/aws/requests/simpledb/select.rb +++ b/lib/fog/aws/requests/simpledb/select.rb @@ -23,7 +23,7 @@ module Fog # * 'NextToken'<~String> - offset to start with if there are are more domains to list def select(select_expression, options = {}) if options.is_a?(String) - Formatador.display_line("[yellow][WARN] get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]") options = {'NextToken' => options} end options['NextToken'] ||= nil diff --git a/lib/fog/aws/requests/storage/get_object_url.rb b/lib/fog/aws/requests/storage/get_object_url.rb index 4ad06bfa4..7d700b7bb 100644 --- a/lib/fog/aws/requests/storage/get_object_url.rb +++ b/lib/fog/aws/requests/storage/get_object_url.rb @@ -18,7 +18,7 @@ module Fog # http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html def get_object_url(bucket_name, object_name, expires) - Formatador.display_line("[yellow][WARN] Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]") get_object_https_url(bucket_name, object_name, expires) end @@ -27,7 +27,7 @@ module Fog class Mock # :nodoc:all def get_object_url(bucket_name, object_name, expires) - Formatador.display_line("[yellow][WARN] Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]") get_object_https_url(bucket_name, object_name, expires) end diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index 8e6ed61a7..060ddbb9e 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -76,7 +76,7 @@ module Fog end def url(params, expires) - Formatador.display_line("[yellow][WARN] #{Fog::Storage::AWS} => #url is deprecated, use #https_url instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("Fog::Storage::AWS => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]") https_url(params, expires) end @@ -305,7 +305,7 @@ DATA subdomain = params[:host].split(".#{@host}").first unless subdomain =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/ - Formatador.display_line("[yellow][WARN] fog: the specified s3 bucket name(#{subdomain}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html[/]") + Fog::Logger.warning("fog: the specified s3 bucket name(#{subdomain}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html") params[:host] = params[:host].split("#{subdomain}.")[-1] if params[:path] params[:path] = "#{subdomain}/#{params[:path]}" @@ -367,7 +367,7 @@ DATA response = @connection.request(params, &block) rescue Excon::Errors::TemporaryRedirect => error uri = URI.parse(error.response.headers['Location']) - Formatador.display_line("[yellow][WARN] fog: followed redirect to #{uri.host}, connecting to the matching region will be more performant[/]") + Fog::Logger.warning("fog: followed redirect to #{uri.host}, connecting to the matching region will be more performant") response = Fog::Connection.new("#{@scheme}://#{uri.host}:#{@port}", false).request(original_params, &block) end diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index 00717bf14..bab038a75 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -19,8 +19,7 @@ module Fog service = self.class_for(service) availability &&= service.requirements.all? { |requirement| Fog.credentials.include?(requirement) } rescue ArgumentError => e - warning = "[yellow][WARN] #{e.message}[/]" - Formatador.display_line(warning) + Fog::Logger.warning(e.message) availability = false rescue => e availability = false diff --git a/lib/fog/bin/aws.rb b/lib/fog/bin/aws.rb index 58820663f..04e2958b5 100644 --- a/lib/fog/bin/aws.rb +++ b/lib/fog/bin/aws.rb @@ -45,17 +45,17 @@ class AWS < Fog::Bin when :auto_scaling Fog::AWS::AutoScaling.new when :cdn - Formatador.display_line("[yellow][WARN] AWS[:cdn] is deprecated, use CDN[:aws] instead[/]") + Fog::Logger.warning("AWS[:cdn] is deprecated, use CDN[:aws] instead") Fog::CDN.new(:provider => 'AWS') when :cloud_formation Fog::AWS::CloudFormation.new when :cloud_watch Fog::AWS::CloudWatch.new when :compute - Formatador.display_line("[yellow][WARN] AWS[:compute] is deprecated, use Compute[:aws] instead[/]") + Fog::Logger.warning("AWS[:compute] is deprecated, use Compute[:aws] instead") Fog::Compute.new(:provider => 'AWS') when :dns - Formatador.display_line("[yellow][WARN] AWS[:dns] is deprecated, use DNS[:aws] instead[/]") + Fog::Logger.warning("AWS[:dns] is deprecated, use DNS[:aws] instead") Fog::DNS.new(:provider => 'AWS') when :elb Fog::AWS::ELB.new @@ -72,7 +72,7 @@ class AWS < Fog::Bin when :sqs Fog::AWS::SQS.new when :storage - Formatador.display_line("[yellow][WARN] AWS[:storage] is deprecated, use Storage[:aws] instead[/]") + Fog::Logger.warning("AWS[:storage] is deprecated, use Storage[:aws] instead") Fog::Storage.new(:provider => 'AWS') when :sns Fog::AWS::SNS.new diff --git a/lib/fog/bin/bluebox.rb b/lib/fog/bin/bluebox.rb index 026200df3..0e24a88f5 100644 --- a/lib/fog/bin/bluebox.rb +++ b/lib/fog/bin/bluebox.rb @@ -16,10 +16,10 @@ class Bluebox < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Bluebox[:compute] is deprecated, use Compute[:bluebox] instead[/]") + Fog::Logger.warning("Bluebox[:compute] is deprecated, use Compute[:bluebox] instead") Fog::Compute.new(:provider => 'Bluebox') when :dns - Formatador.display_line("[yellow][WARN] Bluebox[:storage] is deprecated, use Storage[:bluebox] instead[/]") + Fog::Logger.warning("Bluebox[:storage] is deprecated, use Storage[:bluebox] instead") Fog::DNS.new(:provider => 'Bluebox') else raise ArgumentError, "Unrecognized service: #{service}" diff --git a/lib/fog/bin/brightbox.rb b/lib/fog/bin/brightbox.rb index 738a4b266..e0e749010 100644 --- a/lib/fog/bin/brightbox.rb +++ b/lib/fog/bin/brightbox.rb @@ -14,7 +14,7 @@ class Brightbox < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Brightbox[:compute] is deprecated, use Compute[:brightbox] instead[/]") + Fog::Logger.warning("Brightbox[:compute] is deprecated, use Compute[:brightbox] instead") Fog::Compute.new(:provider => 'Brightbox') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/dnsimple.rb b/lib/fog/bin/dnsimple.rb index 98b557eac..5dd037d2a 100644 --- a/lib/fog/bin/dnsimple.rb +++ b/lib/fog/bin/dnsimple.rb @@ -14,7 +14,7 @@ class DNSimple < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :dns - Formatador.display_line("[yellow][WARN] DNSimple[:dns] is deprecated, use Storage[:dnsimple] instead[/]") + Fog::Logger.warning("DNSimple[:dns] is deprecated, use Storage[:dnsimple] instead") Fog::DNS.new(:provider => 'DNSimple') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/dnsmadeeasy.rb b/lib/fog/bin/dnsmadeeasy.rb index 175f3c1ed..08113c9d4 100644 --- a/lib/fog/bin/dnsmadeeasy.rb +++ b/lib/fog/bin/dnsmadeeasy.rb @@ -14,7 +14,7 @@ class DNSMadeEasy < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :dns - Formatador.display_line("[yellow][WARN] DNSMadeEasy[:dns] is deprecated, use Storage[:dnsmadeeasy] instead[/]") + Fog::Logger.warning("DNSMadeEasy[:dns] is deprecated, use Storage[:dnsmadeeasy] instead") Fog::DNS.new(:provider => 'DNSMadeEasy') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/ecloud.rb b/lib/fog/bin/ecloud.rb index 3b89ae30d..73cdf2a7b 100644 --- a/lib/fog/bin/ecloud.rb +++ b/lib/fog/bin/ecloud.rb @@ -14,7 +14,7 @@ class Ecloud < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Ecloud[:compute] is deprecated, use Compute[:ecloud] instead[/]") + Fog::Logger.warning("Ecloud[:compute] is deprecated, use Compute[:ecloud] instead") Fog::Compute.new(:provider => 'Ecloud') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/go_grid.rb b/lib/fog/bin/go_grid.rb index daefe49be..efe7914d3 100644 --- a/lib/fog/bin/go_grid.rb +++ b/lib/fog/bin/go_grid.rb @@ -14,7 +14,7 @@ class GoGrid < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] GoGrid[:compute] is deprecated, use Compute[:gogrid] instead[/]") + Fog::Logger.warning("GoGrid[:compute] is deprecated, use Compute[:gogrid] instead") Fog::Compute.new(:provider => 'GoGrid') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/google.rb b/lib/fog/bin/google.rb index c8eba4d84..484a2a77d 100644 --- a/lib/fog/bin/google.rb +++ b/lib/fog/bin/google.rb @@ -14,7 +14,7 @@ class Google < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :storage - Formatador.display_line("[yellow][WARN] Google[:storage] is deprecated, use Storage[:google] instead[/]") + Fog::Logger.warning("Google[:storage] is deprecated, use Storage[:google] instead") Fog::Storage.new(:provider => 'Google') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/libvirt.rb b/lib/fog/bin/libvirt.rb index 6e64b9c46..4cc0fae19 100644 --- a/lib/fog/bin/libvirt.rb +++ b/lib/fog/bin/libvirt.rb @@ -14,7 +14,7 @@ module Libvirt # deviates from other bin stuff to accomodate gem @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Libvirt[:compute] is deprecated, use Compute[:libvirt] instead[/]") + Fog::Logger.warning("Libvirt[:compute] is deprecated, use Compute[:libvirt] instead") Fog::Compute.new(:provider => 'Libvirt') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/linode.rb b/lib/fog/bin/linode.rb index 0a56e45f1..ea9d67cea 100644 --- a/lib/fog/bin/linode.rb +++ b/lib/fog/bin/linode.rb @@ -16,10 +16,10 @@ class Linode < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Linode[:compute] is deprecated, use Compute[:linode] instead[/]") + Fog::Logger.warning("Linode[:compute] is deprecated, use Compute[:linode] instead") Fog::Compute.new(:provider => 'Linode') when :dns - Formatador.display_line("[yellow][WARN] Linode[:storage] is deprecated, use Storage[:linode] instead[/]") + Fog::Logger.warning("Linode[:storage] is deprecated, use Storage[:linode] instead") Fog::DNS.new(:provider => 'Linode') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/local.rb b/lib/fog/bin/local.rb index 798fd8d23..b8cadd62f 100644 --- a/lib/fog/bin/local.rb +++ b/lib/fog/bin/local.rb @@ -14,7 +14,7 @@ class Local < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :storage - Formatador.display_line("[yellow][WARN] Local[:storage] is deprecated, use Storage[:local] instead[/]") + Fog::Logger.warning("Local[:storage] is deprecated, use Storage[:local] instead") Fog::Storage.new(:provider => 'Local') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/new_servers.rb b/lib/fog/bin/new_servers.rb index 1aacf34dc..3036812dc 100644 --- a/lib/fog/bin/new_servers.rb +++ b/lib/fog/bin/new_servers.rb @@ -14,7 +14,7 @@ class NewServers < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] NewServers[:compute] is deprecated, use Compute[:newservers] instead[/]") + Fog::Logger.warning("NewServers[:compute] is deprecated, use Compute[:newservers] instead") Fog::Compute.new(:provider => 'NewServers') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/ninefold.rb b/lib/fog/bin/ninefold.rb index 34809701a..58c43d400 100644 --- a/lib/fog/bin/ninefold.rb +++ b/lib/fog/bin/ninefold.rb @@ -16,10 +16,10 @@ class Ninefold < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Ninefold[:compute] is deprecated, use Compute[:ninefold] instead[/]") + Fog::Logger.warning("Ninefold[:compute] is deprecated, use Compute[:ninefold] instead") Fog::Compute.new(:provider => 'Ninefold') when :storage - Formatador.display_line("[yellow][WARN] Ninefold[:storage] is deprecated, use Storage[:ninefold] instead[/]") + Fog::Logger.warning("Ninefold[:storage] is deprecated, use Storage[:ninefold] instead") Fog::Storage.new(:provider => 'Ninefold') else raise ArgumentError, "Unrecognized service: #{service}" diff --git a/lib/fog/bin/rackspace.rb b/lib/fog/bin/rackspace.rb index f2764ddba..b36301d11 100644 --- a/lib/fog/bin/rackspace.rb +++ b/lib/fog/bin/rackspace.rb @@ -22,17 +22,17 @@ class Rackspace < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :cdn - Formatador.display_line("[yellow][WARN] Rackspace[:cdn] is deprecated, use CDN[:rackspace] instead[/]") + Fog::Logger.warning("Rackspace[:cdn] is deprecated, use CDN[:rackspace] instead") Fog::CDN.new(:provider => 'Rackspace') when :compute - Formatador.display_line("[yellow][WARN] Rackspace[:compute] is deprecated, use Compute[:rackspace] instead[/]") + Fog::Logger.warning("Rackspace[:compute] is deprecated, use Compute[:rackspace] instead") Fog::Compute.new(:provider => 'Rackspace') when :dns Fog::DNS.new(:provider => 'Rackspace') when :load_balancers Fog::Rackspace::LoadBalancers.new when :storage - Formatador.display_line("[yellow][WARN] Rackspace[:storage] is deprecated, use Storage[:rackspace] instead[/]") + Fog::Logger.warning("Rackspace[:storage] is deprecated, use Storage[:rackspace] instead") Fog::Storage.new(:provider => 'Rackspace') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/slicehost.rb b/lib/fog/bin/slicehost.rb index f920358a3..6c905bba8 100644 --- a/lib/fog/bin/slicehost.rb +++ b/lib/fog/bin/slicehost.rb @@ -16,10 +16,10 @@ class Slicehost < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Slicehost[:compute] is deprecated, use Compute[:slicehost] instead[/]") + Fog::Logger.warning("Slicehost[:compute] is deprecated, use Compute[:slicehost] instead") Fog::Compute.new(:provider => 'Slicehost') when :dns - Formatador.display_line("[yellow][WARN] Slicehost[:dns] is deprecated, use Storage[:slicehost] instead[/]") + Fog::Logger.warning("Slicehost[:dns] is deprecated, use Storage[:slicehost] instead") Fog::DNS.new(:provider => 'Slicehost') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/stormondemand.rb b/lib/fog/bin/stormondemand.rb index 365f4d065..0ec3d85bf 100644 --- a/lib/fog/bin/stormondemand.rb +++ b/lib/fog/bin/stormondemand.rb @@ -14,7 +14,7 @@ class StormOnDemand < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] StormOnDemand[:compute] is deprecated, use Compute[:stormondemand] instead[/]") + Fog::Logger.warning("StormOnDemand[:compute] is deprecated, use Compute[:stormondemand] instead") Fog::Compute.new(:provider => 'StormOnDemand') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/virtual_box.rb b/lib/fog/bin/virtual_box.rb index d45c0b2c4..7732bb985 100644 --- a/lib/fog/bin/virtual_box.rb +++ b/lib/fog/bin/virtual_box.rb @@ -14,7 +14,7 @@ module VirtualBox # deviates from other bin stuff to accomodate gem @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] VirtualBox[:compute] is deprecated, use Compute[:virtualbox] instead[/]") + Fog::Logger.warning("VirtualBox[:compute] is deprecated, use Compute[:virtualbox] instead") Fog::Compute.new(:provider => 'VirtualBox') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/voxel.rb b/lib/fog/bin/voxel.rb index 8f117d900..8972ccff5 100644 --- a/lib/fog/bin/voxel.rb +++ b/lib/fog/bin/voxel.rb @@ -14,7 +14,7 @@ class Voxel < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :compute - Formatador.display_line("[yellow][WARN] Voxel[:compute] is deprecated, use Compute[:voxel] instead[/]") + Fog::Logger.warning("Voxel[:compute] is deprecated, use Compute[:voxel] instead") Fog::Compute.new(:provider => 'Voxel') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/bin/zerigo.rb b/lib/fog/bin/zerigo.rb index af004f3b3..598c5ec5c 100644 --- a/lib/fog/bin/zerigo.rb +++ b/lib/fog/bin/zerigo.rb @@ -14,7 +14,7 @@ class Zerigo < Fog::Bin @@connections ||= Hash.new do |hash, key| hash[key] = case key when :dns - Formatador.display_line("[yellow][WARN] Zerigo[:dns] is deprecated, use Storage[:zerigo] instead[/]") + Fog::Logger.warning("Zerigo[:dns] is deprecated, use Storage[:zerigo] instead") Fog::DNS.new(:provider => 'Zerigo') else raise ArgumentError, "Unrecognized service: #{key.inspect}" diff --git a/lib/fog/core/deprecation.rb b/lib/fog/core/deprecation.rb index 6a156a188..93f1a3fe0 100644 --- a/lib/fog/core/deprecation.rb +++ b/lib/fog/core/deprecation.rb @@ -4,7 +4,7 @@ module Fog def deprecate(older, newer) module_eval <<-EOS, __FILE__, __LINE__ def #{older}(*args) - Formatador.display_line("[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]") send(:#{newer}, *args) end EOS @@ -13,7 +13,7 @@ module Fog def self_deprecate(older, newer) module_eval <<-EOS, __FILE__, __LINE__ def self.#{older}(*args) - Formatador.display_line("[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]") send(:#{newer}, *args) end EOS diff --git a/lib/fog/ecloud/compute.rb b/lib/fog/ecloud/compute.rb index bef082ca0..96fa8a267 100644 --- a/lib/fog/ecloud/compute.rb +++ b/lib/fog/ecloud/compute.rb @@ -1065,7 +1065,7 @@ module Fog end def self.data_reset - Formatador.display_line("[yellow][WARN] #{self} => #data_reset is deprecated, use #reset instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("#{self} => #data_reset is deprecated, use #reset instead [light_black](#{caller.first})[/]") self.reset end diff --git a/lib/fog/google/models/storage/file.rb b/lib/fog/google/models/storage/file.rb index 23cfbfcd1..7e63e95a7 100644 --- a/lib/fog/google/models/storage/file.rb +++ b/lib/fog/google/models/storage/file.rb @@ -106,7 +106,7 @@ module Fog def save(options = {}) requires :body, :directory, :key if options != {} - Formatador.display_line("[yellow][WARN] options param is deprecated, use acl= instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("options param is deprecated, use acl= instead [light_black](#{caller.first})[/]") end options['x-goog-acl'] ||= @acl if @acl options['Cache-Control'] = cache_control if cache_control diff --git a/lib/fog/google/requests/storage/get_object_url.rb b/lib/fog/google/requests/storage/get_object_url.rb index 86c16ef3a..b55bd3da3 100644 --- a/lib/fog/google/requests/storage/get_object_url.rb +++ b/lib/fog/google/requests/storage/get_object_url.rb @@ -18,7 +18,7 @@ module Fog # http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html def get_object_url(bucket_name, object_name, expires) - Formatador.display_line("[yellow][WARN] Fog::Storage::Google => ##{get_object_url} is deprecated, use ##{get_object_https_url} instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("Fog::Storage::Google => ##{get_object_url} is deprecated, use ##{get_object_https_url} instead[/] [light_black](#{caller.first})") get_object_https_url(bucket_name, object_name, expires) end @@ -27,7 +27,7 @@ module Fog class Mock # :nodoc:all def get_object_url(bucket_name, object_name, expires) - Formatador.display_line("[yellow][WARN] Fog::Storage::Google => ##{get_object_url} is deprecated, use ##{get_object_https_url} instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("Fog::Storage::Google => ##{get_object_url} is deprecated, use ##{get_object_https_url} instead[/] [light_black](#{caller.first})") get_object_https_url(bucket_name, object_name, expires) end diff --git a/lib/fog/google/storage.rb b/lib/fog/google/storage.rb index fef9c1ef2..038a88588 100644 --- a/lib/fog/google/storage.rb +++ b/lib/fog/google/storage.rb @@ -45,7 +45,7 @@ module Fog end def url(params, expires) - Formatador.display_line("[yellow][WARN] Fog::Storage::Google => #url is deprecated, use #https_url instead[/] [light_black](#{caller.first})[/]") + Fog::Logger.warning("Fog::Storage::Google => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]") https_url(params, expires) end @@ -227,7 +227,7 @@ DATA subdomain = params[:host].split(".#{@host}").first unless subdomain =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/ - Formatador.display_line("[yellow][WARN] fog: the specified google storage bucket name(#{subdomain}) is not a valid dns name. See: http://code.google.com/apis/storage/docs/developer-guide.html#naming[/]") + Fog::Logger.warning("fog: the specified google storage bucket name(#{subdomain}) is not a valid dns name. See: http://code.google.com/apis/storage/docs/developer-guide.html#naming") params[:host] = params[:host].split("#{subdomain}.")[-1] if params[:path] params[:path] = "#{subdomain}/#{params[:path]}" diff --git a/lib/fog/terremark/vcloud.rb b/lib/fog/terremark/vcloud.rb index 94c7c67e0..4b08a71ca 100644 --- a/lib/fog/terremark/vcloud.rb +++ b/lib/fog/terremark/vcloud.rb @@ -15,10 +15,7 @@ module Fog extend Fog::Terremark::Shared def self.new(options={}) - location = caller.first - warning = "[yellow][WARN] Fog::Terremark::Vcloud is deprecated, to be replaced with Vcloud 1.0 someday/maybe[/]" - warning << " [light_black](" << location << ")[/] " - Formatador.display_line(warning) + Fog::Logger.warning("Fog::Terremark::Vcloud is deprecated, to be replaced with Vcloud 1.0 someday/maybe [light_black](#{caller.first})[/]") unless @required shared_requires