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

Rhel7 fix 1404158 #987

Merged
merged 3 commits into from Mar 15, 2017
Merged

Conversation

jkonecny12
Copy link
Member

Fix Software spoke.

  1. Fix Software spoke radio buttons, you don't need to click twice on them now.
  2. Fix Software spoke with partial kickstart. Now it will select groups from your kickstart file.

@jkonecny12 jkonecny12 force-pushed the rhel7-fix-1404158 branch 2 times, most recently from bc2e2fd to 02c7171 Compare March 8, 2017 16:36
Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Small suggestion for the last commit:

"However if user visits the Software
spoke it will erase kickstart settings and use user settings."

->

"However if user visits the Software spoke the settings from kickstart (environment & groups) will be replaced by what the user selects in the spoke. Individual package selection from kickstart should be unaffected."

These aside looks really good to me - thanks for looking into this! :)

@@ -156,7 +160,12 @@ def _payload_error(self):
hubQ.send_message(self.__class__.__name__, payloadMgr.error)

def _apply(self):
if self.environment and not (flags.automatedInstall and self.data.packages.seen):
# Environment have to be set by GUI but not by kickstart
Copy link
Contributor

Choose a reason for hiding this comment

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

Rewording suggestion:

Environment needs to be set during a GUI installation, but is not required for a kickstart install (even partial)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

@poncovka poncovka left a comment

Choose a reason for hiding this comment

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

Some suggestions, but looks good to me otherwise.

@@ -464,6 +461,19 @@ def _get_selected_addons(self):

return retval

def _mark_addon_selection(self, grpid, active):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe selected instead of active? There is no gui in this function, so active does not make much sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds better to me. Fixed.

"""
groups = self._yumGroups
if not groups:
return ""
Copy link
Contributor

Choose a reason for hiding this comment

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

This will cause that self._addonStates[""] will be set several times to self._ADDON_SELECTED. Maybe it would be better to raise an exception, since we catch PayloadError anyway when selectedGroupsIDs is called.

Copy link
Member Author

Choose a reason for hiding this comment

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

I want to have the same behavior as groupDescription() method has, this method is returning (groupid, groupid).

It would be unexpected behavior when one method is returning something and second similar method below raising an exception.

Also catching an exception takes more performance than rewriting value in a dictionary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, but we could at least return None and check the id before we modify self._addonStates.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to see return None. I think it is straight way to hard debugging because you never know where this will propagate in future, and None is acting as normal value in many ways.

However you are right that the empty string is not the right solution here. So last man standing, use an exception. I don't like it here either for reasons above but it is smallest evil right now. Therefore I'm going to change this to exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's an unexpected/exceptional case, right?

Removed selectedGroups which is not helpful and use addonStates
dictionary instead. The addonStates variable has 3 states, SELECTED,
DESELECTED and DEFAULT. When you change the state to the environment
default, it will return state in the addonStates variable to DEFAULT.

Remove code for removing groups from selectedGroups array when changing
environment; this is not required anymore when the state is read from
buttons.

Groups marked for installation are read from GTK now.

Resolves: rhbz#1404158

Reported-by: Vit Ry <Frodox@zoho.com>
Removed excludedGroups which was always empty array.

Removed _parseEnvironments() method which wasn't called anywhere and
it's not required by the code.

Related: rhbz#1404158
@jkonecny12
Copy link
Member Author

UPDATED
Comment should be fixed now. Thanks!

When groups are selected in %packages section in a kickstart file, mark
these groups in the Software spoke. However if the user visits the
Software spoke the settings from kickstart (environment & groups) will
be replaced by what the user selects in the spoke. Individual package
selection from kickstart should be unaffected.

Kickstart file without user interaction is the only option how to
install groups and packages which are not inside of the selected
environment.

Related: rhbz#1404158
@jkonecny12
Copy link
Member Author

Is it OK now @poncovka ?

Copy link
Contributor

@poncovka poncovka left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

@jkonecny12 jkonecny12 merged commit beeaa50 into rhinstaller:rhel7-branch Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants