Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the GUI-selected environment in the ksdata (#1192100) #89

Closed
wants to merge 1 commit into from

Conversation

dashea
Copy link
Contributor

@dashea dashea commented Apr 24, 2015

This way an environment selected in the GUI and an environment selected
in kickstart are treated in the same way. This fixes the problem where
changing payloads forgets the previous environment selection, and it
changes the generated %packages section of anaconda-ks.cfg to contain
the environment information instead of a list of the groups in the
environment.

This commit restores the dnf _select_environment method removed in
602f47d, but modifies it so that the
environment is both selected in dnf and in the kickstart data.

# the group list
if self.data.packages.environment and \
groupid not in self.environmentGroups(self.data.packages.environment):
self.data.packages.groupList.append(grp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay that we don't add the group to the list if no environment is selected? I'd expect it to be added so please extend the comment a bit to explain why that's not happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok because with this patch the environment gets added to the ksdata instead of just its groups, and the selected environment gets added to the payload via dnf.Base.environment_install or yum.selectEnvironment. I'll change the comment to "If the group is part of the environment, it is already selected as part of the environment. Do not duplicate it in the group list"

@vpodzime
Copy link
Contributor

Other than the two comments above this looks good to me.

@vpodzime vpodzime added the ACK label Apr 27, 2015
@dashea dashea added NACK and removed ACK labels Apr 29, 2015
@dashea
Copy link
Contributor Author

dashea commented Apr 29, 2015

Unacking because this messes up the dnf group exclusion logic and I want to make sure I don't get distracted and forget to fix that.

This way an environment selected in the GUI and an environment selected
in kickstart are treated in the same way. This fixes the problem where
changing payloads forgets the previous environment selection, and it
changes the generated %packages section of anaconda-ks.cfg to contain
the environment information instead of a list of the groups in the
environment.

PackagePayload.selectEnvironment now only sets the environment in the
ksdata and does not modify the group lists. The PackagePayload
implementations must instead apply the ksdata environment to the
internal package selections when ksdata selections are applied.
@dashea
Copy link
Contributor Author

dashea commented May 6, 2015

Redid the patch so that environment selections are applied to dnf as a series of group selections (so group exclusion works), changed PackagePayload.selectEnvrionment to just set the environment in ksdata and not do anything with groups, and changed the dnf and yum apply_selections to only call their internal environment methods instead of going back to selectEnvironment again.

@vpodzime
Copy link
Contributor

vpodzime commented May 7, 2015

Looks good and makes sense to me.

@vpodzime vpodzime added the ACK label May 7, 2015
@dashea dashea closed this May 7, 2015
@dashea dashea deleted the pyaload-environment branch May 7, 2015 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants