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 2/2] CIMI - fixes MachineVolume:
Date Thu, 29 Nov 2012 22:06:28 GMT
On Wed, 2012-11-28 at 13:24 +0200, marios@redhat.com wrote:
> From: marios <marios@redhat.com>
> 
>   *  attach/detach operations on Machine model
>   *  correct generation of MachineVolume collection

I have a question about this patch:

> diff --git a/server/lib/cimi/models/machine_volume.rb
> b/server/lib/cimi/models/machine_volume.rb
> index f5fa966..bb6a8a1 100644
> --- a/server/lib/cimi/models/machine_volume.rb
> +++ b/server/lib/cimi/models/machine_volume.rb
> ...
> +  def self.collection_for_instance(instance_id, context)
> +    machine_volumes = self.find(instance_id, context)
> +    volumes_url = context.url("/machines/#{instance_id}/volumes")
> +    unless CIMI::Model.const_defined?('MachineVolumeCollection')
> +      collection_class = CIMI::Model::Collection.generate(self)
> +    else
> +      collection_class = CIMI::Model::MachineVolumeCollection
> +    end

As of commit b02acbd1, embedded collections (those declared through
'collection' in another model class) will be generated in the namespace
of the containing class. IOW, there should always be a
CIMI::Model::Machine::MachineVolumeCollection - was that not the case
here ?

David



Mime
View raw message