server/lib/deltacloud/drivers/mock/mock_driver.rb
def attach_volume_instance(volume_id, device, instance_id)
      volume = @client.load(:storage_volumes, volume_id)
      instance = @client.load(:instances, instance_id)
      volume[:instance_id] = instance_id
      volume[:device] = device
      volume[:state] = "IN-USE"
      instance[:storage_volumes] ||= []
      instance[:storage_volumes] << {volume_id=>device}
      @client.store(:storage_volumes, volume)
      @client.store(:instances, instance)
      StorageVolume.new(volume)
    end
# If the provider is set to storage, pretend to be a storage-only
# driver
If the provider is set to storage, pretend to be a storage-only
driver
If the provider is set to storage pretend to be a storage - only driver
def attach_volume_instance(volume_id, device, instance_id)
      volume = @client.load(:storage_volumes, volume_id)
      instance = @client.load(:instances, instance_id)
      volume[:instance_id] = instance_id
      volume[:device] = device
      volume[:state] = "IN-USE"
      instance[:storage_volumes] ||= []
      instance[:storage_volumes] << {volume_id=>device}
      @client.store(:storage_volumes, volume)
      @client.store(:instances, instance)
      StorageVolume.new(volume)
    end
def attach_volume_instance ( volume_id , device , instance_id ) volume = @client . load ( :storage_volumes , volume_id ) instance = @client . load ( :instances , instance_id ) volume [ :instance_id ] = instance_id volume [ :device ] = device volume [ :state ] = "IN-USE" instance [ :storage_volumes ] ||= [ ] instance [ :storage_volumes ] << { volume_id => device } @client . store ( :storage_volumes , volume ) @client . store ( :instances , instance ) StorageVolume . new ( volume ) end
If the provider is set to storage, pretend to be a storage-only
driver
If the provider is set to storage pretend to be a storage - only driver
volume_id
device
instance_id