incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH] azure blob storage driver - very early prototype with basic functions
Date Fri, 27 Aug 2010 00:03:12 GMT
On Tue, 2010-08-24 at 18:52 +0100, mandreou@redhat.com wrote:
> diff --git a/server/lib/deltacloud/drivers/azure/azure_driver.rb b/server/lib/deltacloud/drivers/azure/azure_driver.rb
> new file mode 100644
> index 0000000..780e278
> --- /dev/null
> +++ b/server/lib/deltacloud/drivers/azure/azure_driver.rb
> @@ -0,0 +1,105 @@
>
> +#Windows Azure (WAZ) gem at http://github.com/johnnyhalife/waz-storage
> +require 'waz-blobs'
> +require 'deltacloud/base_driver'
> +module Deltacloud
> +  module Drivers
> +    module Azure
> +
> +class AzureDriver < Deltacloud::BaseDriver
> +
> +  def supported_collections
> +    DEFAULT_COLLECTIONS.reject! { |c| [:hardware_profiles, :images, :instances, :instance_states,
> +                                      :realms, :storage_volumes, :storage_snapshots
 ].include?(c) }
> +    DEFAULT_COLLECTIONS + [:containers]
> +  end

Could just do 'def supported_collections; [:containers] end' here ;)

> +  def blobs(credentials, opts)
> +    blob_list = []
> +    unless opts['container'] then
> +      raise Deltacloud::Validation::Failure.new(Deltacloud::Validation::Param.new(["container"]),
"Error - need container name to retrieve the blob list. You said container->#{opts['container']}.")
> +    end

Shouldn't this be handled by the declaration of containers in
server.rb ? In particular, since :container is part of the URL, this
method would never be called if it's not there.

Other than that, looks great.

David



Mime
View raw message