Bug 997524 - rfe: determine whether a groupid in optionlist in an environment is default
rfe: determine whether a groupid in optionlist in an environment is default
Product: Fedora
Classification: Fedora
Component: libcomps (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jindrich Luza
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-08-15 09:55 EDT by Ales Kozumplik
Modified: 2014-09-30 19:41 EDT (History)
3 users (show)

See Also:
Fixed In Version: libcomps-0.1.3-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-27 10:34:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ales Kozumplik 2013-08-15 09:55:12 EDT
Suppose the following comps:

      <groupid default="true">libreoffice</groupid>

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.
Comment 1 Ales Kozumplik 2013-08-15 09:59:17 EDT
(FWIW this prevents proper implementation of DNFPayload.environmentOptionIsDefault in Anaconda)
Comment 2 Jindrich Luza 2013-08-19 04:25:02 EDT
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.
Comment 3 Ales Kozumplik 2013-08-19 05:23:22 EDT
(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.
Comment 4 Fedora Update System 2013-08-20 10:11:25 EDT
libcomps-0.1.3-1.fc19 has been submitted as an update for Fedora 19.
Comment 5 Fedora Update System 2013-08-20 20:04:34 EDT
Package libcomps-0.1.3-1.fc19:
* 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).
Comment 6 Ales Kozumplik 2013-08-26 06:34:50 EDT
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!
Comment 7 Jindrich Luza 2013-08-27 10:34:34 EDT
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:
   group_ids.append("some id")
for groupid with default attribute set to False. And then you can set default attribute as
   group_ids[0].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"))
 group_ids.append(libcomps.GroupId("some id", default=False))

Default attribute API explanation is included in tests for
libcomps-0.1.3-2 build
Comment 8 Fedora Update System 2013-09-29 20:29:39 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.