On Tue, 2015-02-03 at 00:23 -0800, Adam Williamson wrote:
> On Mon, 2015-02-02 at 16:52 -0800, Adam Williamson wrote:
> 
> > Does this all sound reasonable? If no-one objects, I'll work on 
> > extending python-wikitcms' handling of images tomorrow, then 
> > submit some patches for the OpenQA bits.
> 
> So I did a bit of work on this, and now I'm thinking of something a 
> bit more ambitious: a sort of 'Fedora Finder' thing that knows how 
> to find media - lives, Products, boot.iso , ARM images, whatever - 
> for any given Fedora release, pre-release, TC/RC, or nightly. python-
> wikitcms could then hook into that to provide properties for Events, 
> and the OpenQA stuff can either use the info via python-wikitcms or 
> directly, whichever seems to make more sense.

So Fedora Finder is now a definite Thing:

https://www.happyassassin.net/cgit/fedfind/

it's even a proper Python package now. I'm still bashing on bits and 
deciding what's 'API' and what isn't (I'm not sure if you should call, 
say, get_boot_images() directly) and documenting and things, but I'll 
say for now you should be safe doing this:

import fedfind.release

rel = fedfind.release.RawhideNightly(datetime.date(2015, 02, 04))
opts = dict(imagetype=('boot',))
imgs = rel.find_images(opts)

which will find all boot.isos that exist for the 2015-02-04 nightly 
compose. (Right now netinsts and boot.isos are treated as 
fundamentally separate things, netinsts have imagetype 'netinst', 
boot.isos have imagetype 'boot', though of course for nightly composes 
there aren't any netinsts). You get 'Image' objects, whose __str__ is 
simply their URL so if that's all you want you can get it:

for img in imgs:
        print(img)

But they also have a bunch of other properties representing image type 
and arch and stuff:

for img in imgs:
        print(img.arch)

The find_images opts dict lets you match any set of Image attributes 
against an iterable of values (you can't do an 'OR'-type search 
against multiple attributes yet, sorry):

opts = dict(arch=('x86_64','i686','i386'),flavor=('workstation','server'))

will find all Intel Workstation and Server images, for e.g.

For now there are three release classes, RawhideNightly, 
BranchedNightly (you have to pass that one a release as well as a 
date), and Compose (release, milestone, compose). I'll implement 
stable releases and milestone releases later, I guess. I also designed 
it to be extensible to find things other than release media - 
torrents? PXE images? One of those things where it's hard to know when 
to stop. Right now it certainly does what relval/wikitcms and openqa 
need, though, so I should probably just polish it up a bit more and 
cut a release of it, then we can make use of it. I'll do that tomorrow.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net

_______________________________________________
qa-devel mailing list
qa-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/qa-devel

Reply via email to