Red Hat Bugzilla – Bug 997524
rfe: determine whether a groupid in optionlist in an environment is default
Last modified: 2014-09-30 19:41:42 EDT
Suppose the following comps:
With Python, one can find out the groupids of the options as env.option_ids
But how to tell which ones have default=true set and which ones do not? Maybe it's possible and I just can't figure out how, but the parsing code seems to suggest we actually ignore the value.
(FWIW this prevents proper implementation of DNFPayload.environmentOptionIsDefault in Anaconda)
Yes, Your conclusion is right. Current version is unable to deal with default attribute in groupid element, because it wasn't considerated. I'll try modify library to be capable handle this as fast as I can.
Will You require default attribute in grouplist -> groupid element as well, or just in case you mentioned.
(In reply to Jindrich Luza from comment #2)
> Will You require default attribute in grouplist -> groupid element as well,
> or just in case you mentioned.
I don't require it per-se, but it is probably a good idea to extend the API to support it too.
libcomps-0.1.3-1.fc19 has been submitted as an update for Fedora 19.
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libcomps-0.1.3-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Jindrich, how does one use the new API to determine the default parameter? I looked at 08008e492804c488a4a97712785ed99880343d69 and am none the wiser: there's no unit test nor a release note. Can you please provide an example? Thanks!
I thought API for default attribute is obvious. But maybe You're right, I should shed more light on this. For backward compatibilty you don't have to create special object for groupid attribute, and could use:
for groupid with default attribute set to False. And then you can set default attribute as
group_ids.default = True.
Or one line aproach:
group_ids.append(libcomps.GroupId("some id", default=True)).
Obviously you can use something like:
group_ids.append(libcomps.GroupId("some id", default=False))
Default attribute API explanation is included in tests for
libcomps-0.1.3-1.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.