[PATCH 1/2] Fix getting dracut setup args from dasd.conf. (#950964)
Vratislav Podzimek
vpodzime at redhat.com
Tue Apr 16 09:02:45 UTC 2013
On Mon, 2013-04-15 at 09:57 -0500, David Lehman wrote:
> ---
> blivet/devices.py | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/blivet/devices.py b/blivet/devices.py
> index 74015a2..f289410 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -3817,8 +3817,11 @@ class DASDDevice(DiskDevice):
> if os.path.isfile(conf):
> f = open(conf)
> # grab the first line that starts with our busID
> - line = [line for line in f.readlines()
> - if line.startswith(self.busid)][:1]
> + for l in f.readlines():
> + if l.startswith(self.busid):
> + line = l.rstrip()
> + break
> +
You could use 'for l in f:' which does the same, but possibly in a
faster way skipping the list of all lines creation.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list