[et-mgmt-tools] virtinst/ImageFetcher.patch

Daniel P. Berrange berrange at redhat.com
Tue Apr 8 19:24:27 UTC 2008


On Tue, Apr 08, 2008 at 06:26:53PM +0000, James Laska wrote:
> Greetings,
> 
> Spoke with Dan Berrangé on irc about using virtinst/ImageFetcher.py for
> use in the snake project.  I've basically copied the contents with a few
> tweaks.  Dan suggested sending the patch to et-mgmt-tools at redhat.com for
> comments/thoughts.  The patch consists of 3 main hunks:
> 
>  1 Split acquireFile() into 2 new methods 
>    > saveFile() - does what acquireFile() does now, downloads file,
> writes contents to disk, returns its path
>    > loadFile() - downloads file and returns file contents
> 
>  2 MountedImageFetcher().prepareLocation() will check if the requested
> server:/path is already mounted
>    > Supporting mtab code can be found at
> http://git.fedorahosted.org/git/snake?p=snake;a=blob;f=snake/util.py;h=5815e28ce98e3a5c9dd0b0ec7b380cc05fd39d6c;hb=HEAD
> 
>  3 LocalImageFetcher()._acquireFile() will use grabber.urlopen so that
> it can make use of of the progress callback when copying files via
> saveTemp() calls.

There's a couple  of chunks in this paatch which directly depend on
snake. eg

-        ret = subprocess.call(cmd)
+        ret = snake.util.pcall(cmd, stderr=open('/dev/null', 'w'))

Aside from that, it looks reasonable.

Dan
-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the et-mgmt-tools mailing list