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
Conversation
# the group list | ||
if self.data.packages.environment and \ | ||
groupid not in self.environmentGroups(self.data.packages.environment): | ||
self.data.packages.groupList.append(grp) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
Other than the two comments above this looks good to me. |
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.
9c9e899
to
b367783
Compare
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. |
Looks good and makes sense to me. |
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.