From: Will P. <pa...@dc...> - 2003-12-18 18:45:00
|
Joel S writes: > We frequently are asked questions like, "What hosts have > Perl 5.6.0 installed?" Another favorite is, "Tell me all > the packages installed on host abcd." > > Ark has answers to these questions squirreled away in > /sys/ark-state. Is there an an ark invocation to display > the answers? There is as yet no known code to wander about in the ark-state dir. Note that the questions could be answered in two subtly different ways: (a) looking at what the state says [as you suggest], and (b) looking at the ARK source, which tells you what the state *should* say :-). If you're lucky, the two say the same thing. A little script [Python's easiest] of the (b) form wouldn't be too hard. A sample (which actually ran for glasli1) is A little script [Python's easiest] below. Will #!/usr/local/bin/python import ark.package import ark.host pkgsMgr = ark.package.ArkPkgsMgr() hostsMgr = ark.host.ArkHostsMgr() for pkg in pkgsMgr.getAll(): if not pkg.isRelevant(): continue print pkg.idString, ":", for host in hostsMgr.getAll(): if not host.isRelevant(): continue if pkg.appliesToHost(host) != None: print host.idString, print '' |