On Wed, 2010-09-15 at 14:25 +0200, jprov...@redhat.com wrote:
> From: Jan Provaznik <jprov...@redhat.com>
> 
> TBD: passing credentials and image uuid to image_builder_service.rb

This mostly looks good, think you have all the pieces here we discussed
design-wise.  I'll hold on ack until I get through the rest of the
series, just wanted you to know it was looked at today. Took me a while
but I have a real warehouse running now to test against, got useful
commands from jeff:

* put a file into a bucket: curl -T myfile
http://localhost:9090/my_bucket/myfile
* create a bucket: curl -X PUT http://localhost:9090/my_bucket

If you need sample repo.json, let me know, but I think you have that
already.

I already mentioned to you we need 2 fields for x509 (public/private),
just saying it again here to make sure we don't forget it, and there is
a line below that I think was accidentally committed.  Other than
meetings, finishing this review is what I plan to do tomorrow, think we
should be able to get this in by friday.

-j
> ---

> diff --git a/src/runner/image_builder_service.rb 
> b/src/runner/image_builder_service.rb
> index 5d42725..5d386c5 100644
> --- a/src/runner/image_builder_service.rb
> +++ b/src/runner/image_builder_service.rb
> @@ -24,6 +24,7 @@
>  #   ruby image_builder_service.rb
>  
>  $: << File.join(File.dirname(__FILE__), "../dutils")
> +$: << '/home/jprovazn/devel/deltacloud/image_builder/console/lib'

This line ^
If you have built and installed the gem, this should not be needed.

>  require 'dutils'
>  require "image_builder_console"
>  require 'logger'
> @@ -47,8 +48,8 @@ class ImageBuilderService
>    end
>  
>    def check_for_queued
> -    queue = ImageDescriptorTarget.find(:all, :conditions => {:status => 
> ImageDescriptorTarget::STATE_QUEUED})
> -    cur_builds = ImageDescriptorTarget.find(:all, :conditions => "build_id 
> IS NOT NULL AND status != 'complete'")
> +    queue = Image.find(:all, :conditions => {:status => Image::STATE_QUEUED})
> +    cur_builds = Image.find(:all, :conditions => "build_id IS NOT NULL AND 
> status != 'complete'")
>      if queue.size > 0 || cur_builds.size > 0
>        puts "========================================"
>        puts "Queued Builds: " + queue.size.to_s
> @@ -66,7 +67,7 @@ class ImageBuilderService
>        puts "========================================"
>        puts "target: " + descriptor_target.name + ", status: " + 
> descriptor_target.status
>        puts "========================================"
> -      ab = 
> @console.build_image(descriptor_target.image_descriptor.xml.to_xml, 
> descriptor_target.name)
> +      ab = @console.build_image(descriptor_target.template.xml.to_xml, 
> descriptor_target.name)
>        if ab
>          update_build_list(ab, descriptor_target)
>          descriptor_target.build_id = ab.object_id.to_s
> @@ -112,8 +113,8 @@ class ImageBuilderService
>      puts "========================================"
>      puts "Getting ar object to update using " + obj[:build].target.inspect + 
> " and " + obj[:ar_id].inspect + " ..."
>      puts "========================================"
> -    idt = ImageDescriptorTarget.find(:first, :conditions => { :name => 
> obj[:build].target.to_s,
> -                                                              
> :image_descriptor_id => obj[:ar_id].to_i })
> +    idt = Image.find(:first, :conditions => { :name => 
> obj[:build].target.to_s,
> +                                                              :template_id 
> => obj[:ar_id].to_i })
>      puts "========================================"
>      puts "Updating with status: " + new_status
>      puts "========================================"
> @@ -143,7 +144,7 @@ class ImageBuilderService
>  
>    def update_build_list(ab, target)
>      @activebuilds <<
> -          { :ar_id => target.image_descriptor.id,
> +          { :ar_id => target.template.id,
>              :build => ab,
>              :status => target.status,
>              :build_id => ab.object_id.to_s
> @@ -151,4 +152,4 @@ class ImageBuilderService
>    end
>  end
>  
> -ImageBuilderService.new
> \ No newline at end of file
> +ImageBuilderService.new


_______________________________________________
deltacloud-devel mailing list
deltacloud-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to