-
Notifications
You must be signed in to change notification settings - Fork 88
Switch distro-specific module streams #15
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
Conversation
Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
In draft state while I do a final test |
…e end Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
dnf module install -y "${module}":ol | ||
;; | ||
*) | ||
echo "Unsure how to transform module ${module}" |
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.
We should either break here or get user confirmation to continue, instead of just logging the exception.
I would then rewrite this as "Cannot switch enabled module \"${module}\" to Oracle Linux. Continue switching (y/N):
with "no" as the default option.
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.
At this point in the code the core OS has been switched and we're tidying up the edge cases. We can't easily revert the changes already made so I don't think halting would help. I appreciate it's something that should be strongly highlighted to the user to replace a line that may scroll by.
What do you think of a summary at the end indicating that a module $x couldn't be automatically switched and requires manual intervention?
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.
I think we should move this test to before we do anything that changes the system so that users have the option to abort the switch before any damage is done.
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.
OK, I'll leave this modify code at the end but I'll add a check at the start to see if there are rhel* streams enabled that we aren't familiar with.
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.
Thant seems like a perfectly cromulent solution.
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.
Implemented change. I temporarily disabled knowledge of the virt:rhel stream and this is the output:
$ sudo bash up.sh
Checking for required packages...
Checking your distribution...
Checking for yum lock...
Checking for required python packages...
Identifying dnf modules that are enabled
This tool is unable to automatically switch module 'virt' from a CentOS 'rhel' stream to
an Oracle Linux equivalent. Do you want to continue and resolve it manually?
You may want select No to stop and raise an issue on https://github.com/oracle/centos2ol/ or contact <[email protected]> for advice.
1) Yes
2) No
#? 2
Unsure how to switch module 'virt'. Exiting as requested
For assistance, please email <[email protected]>.
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.
What if there are multiple unknown modules? This format seems very single-module specific.
Also, only provide the GitHub URL, not the email address.
Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
Signed-off-by: Mark Cram <[email protected]>
…tails Signed-off-by: Mark Cram <[email protected]>
Some
dnf module
s are named after a distribution('rhel' or 'rhel8'). Switch them to to the 'ol' or 'ol8' equivalents. Resolves #8An example of CentOS8:
Signed-off-by: Mark Cram [email protected]