Well I still have to parse the output and make sure it returns correct data. So the loop will just be faster, but the code won't change much. Even if it is just one line, in the last comment you pointed out, that I assume too much here. Martin ----- "David Cantrell" <dcantrell@xxxxxxxxxx> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Wed, 2 Dec 2009, Martin Sivak wrote: > > > --- > > isys/isys.py | 11 +++++++++++ > > 1 files changed, 11 insertions(+), 0 deletions(-) > > > > diff --git a/isys/isys.py b/isys/isys.py > > index 338ca26..94ce039 100755 > > --- a/isys/isys.py > > +++ b/isys/isys.py > > @@ -393,6 +393,17 @@ def ext2HasJournal(device): > > hasjournal = _isys.e2hasjournal(device); > > return hasjournal > > > > +def modulesWithPaths(): > > + mods = [] > > + for modline in open("/proc/modules", "r"): > > + modName, _ = modline.split(" ", 1) > > + modInfo = os.popen("modinfo '%s'" % > (modName,)).readlines() > > + modPaths = [ line[9:].strip() > > + for line in modInfo > > + if line.startswith("filename:") ] > > Why not run 'modinfo -F filename %s' here instead and eliminate the > iteration > over modInfo? > > > + mods.extend(modPaths) > > + return mods > > + > > def driveUsesModule(device, modules): > > """Returns true if a drive is using a prticular module. Only > works > > for SCSI devices right now.""" > > > > - -- > David Cantrell <dcantrell@xxxxxxxxxx> > Red Hat / Honolulu, HI > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAksdaAMACgkQ5hsjjIy1VkkZRgCfU2HgEYvcV01OahH4UfT8daDv > 4/cAniFhIxsNuJdq6/XKMbYW+1i6rVVj > =nYri > -----END PGP SIGNATURE----- > > _______________________________________________ > Anaconda-devel-list mailing list > Anaconda-devel-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/anaconda-devel-list _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list