[blivet 05/13] Raise ValueError in BTRFS constructor if no parents specified.
Anne Mulhern
amulhern at redhat.com
Fri Dec 6 17:19:21 UTC 2013
----- Original Message -----
> From: "Chris Lumens" <clumens at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, December 6, 2013 11:57:58 AM
> Subject: Re: [blivet 05/13] Raise ValueError in BTRFS constructor if no parents specified.
>
> > diff --git a/blivet/devices.py b/blivet/devices.py
> > index f8bc836..fe3bb1c 100644
> > --- a/blivet/devices.py
> > +++ b/blivet/devices.py
> > @@ -4252,6 +4252,9 @@ class BTRFSDevice(StorageDevice):
> > if not args or not args[0]:
> > args = ("btrfs.%d" % Device._id,)
> >
> > + if "parents" not in kwargs or kwargs["parents"] is None:
> > + raise ValueError("BTRFSDevice must have at least one parent")
> > +
> > self.req_size = kwargs.pop("size", None)
> > super(BTRFSDevice, self).__init__(*args, **kwargs)
>
> The following would be an equivalent piece of python for this test:
>
> if kwargs.get("parents") is None:
> ...
>
> - Chris
Yup, fixed in working copy.
- mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list