[PATCH] Implement DNFPayload.environmentOptionIsDefault (#1179905)
Samantha N. Bueno
sbueno+anaconda at redhat.com
Thu Jan 8 15:21:17 UTC 2015
On Thu, Jan 08, 2015 at 10:20:01AM -0500, David Shea wrote:
> On 01/08/2015 10:15 AM, Samantha N. Bueno wrote:
> >On Thu, Jan 08, 2015 at 09:43:18AM -0500, David Shea wrote:
> >>---
> >> pyanaconda/packaging/dnfpayload.py | 5 ++++-
> >> 1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
> >>index f8bfdea..3b223d3 100644
> >>--- a/pyanaconda/packaging/dnfpayload.py
> >>+++ b/pyanaconda/packaging/dnfpayload.py
> >>@@ -559,7 +559,10 @@ class DNFPayload(packaging.PackagePayload):
> >> env = self._base.comps.environment_by_pattern(environmentid)
> >> if env is None:
> >> raise packaging.NoSuchGroup(environmentid)
> >>- return False
> >>+
> >>+ # Look a group in the optionlist that matches the group_id and
> >Look for a group?
>
> Yeah. The method is called while iterating over the optionlist in a comps
> environment, and needs to return true if the given grpid is in the
> optionlist and has default=true in the groupid attributes. I guess it could
> be argued that the method should raise NoSuchGroup if grpid isn't in the
> optionlist.
Heh, sorry, I just meant my comment as a correction to your wording. :P
> >
> >>+ # has default set
> >>+ return any(grp for grp in env.option_ids if grp.name == grpid and grp.default)
> >> def groupDescription(self, grpid):
> >> """ Return name/description tuple for the group specified by id. """
> >>--
> >>2.1.0
> >>
> >>_______________________________________________
> >>anaconda-patches mailing list
> >>anaconda-patches at lists.fedorahosted.org
> >>https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> >_______________________________________________
> >anaconda-patches mailing list
> >anaconda-patches at lists.fedorahosted.org
> >https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
> _______________________________________________
> 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