On Tue, 2008-04-08 at 20:24 +0100, Daniel P. Berrange wrote:
> 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 firstname.lastname@example.org 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.
subprocess doesn't exist on RHEL3 and RHEL4, so I had to provide a
helper to fill in the blanks in those environments.
Additionally, there is some snake.util.get_mtab() methods that would
need definition if that chunk is used.
James Laska -- email@example.com
Quality Engineering -- Red Hat, Inc.
et-mgmt-tools mailing list