[PATCH 1/5] Add ability to grab 70-anaconda.rules udev data directly.
Brian C. Lane
bcl at redhat.com
Thu Feb 7 20:19:01 UTC 2013
On Tue, Feb 05, 2013 at 05:05:38PM -0600, David Lehman wrote:
> + _vars = rc.split()
> + info = {}
> + for var in _vars:
> + (name, equals, value) = var.partition("=")
> + if not equals:
> + continue
>
> - # don't raise an exception if pv is not a part of any vg
> - pv_name = vals[0]
> - try:
> - vg_name, vg_uuid = vals[2], vals[3]
> - except IndexError:
> - vg_name, vg_uuid = "", ""
> -
> - info = {'pv_name': pv_name,
> - 'vg_name': vg_name,
> - 'vg_uuid': vg_uuid}
> + if "," in value:
> + val = value.strip().split(",")
> + else:
> + val = value.strip()
> +
> + info[name] = val
Looks like this could be turned into a utility method, since something
very similar is also used below.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130207/e1b02701/attachment.sig>
More information about the anaconda-patches
mailing list