-
Notifications
You must be signed in to change notification settings - Fork 9
Add a utility scripts to switch to new client tools #35
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
base: main
Are you sure you want to change the base?
Conversation
…ojects to new client tools
5bce18a to
4698987
Compare
70b7958 to
bee222a
Compare
… mirrored products
bee222a to
e18e406
Compare
| @@ -0,0 +1,308 @@ | |||
| """ | |||
| # (c) 2019 SUSE Linux GmbH, Germany. | |||
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 should be updated and use the correct date and the correct SUSE name. See https://opensource.suse.com/legal/policy.
| log("Logged out successfully.") | ||
|
|
||
| if __name__ == "__main__": | ||
| main() No newline at end of file |
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.
| main() | |
| main() | |
A newline is missing at the end.
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.
Pull Request Overview
This PR adds two utility scripts to help migrate from old client tools to new client tools in SUSE Manager/Uyuni environments. The scripts provide automated support for syncing new client tools channels and updating existing configurations.
- Adds
sync_client_tools.pyto sync unsynced client tools channels for already mirrored products - Adds
migrate_to_new_client_tools.pyto update CLM projects and activation keys to use new client tools channels
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| uyuni-tools/sync_client_tools.py | Script to sync client tools channels that aren't already synced for mirrored products |
| uyuni-tools/migrate_to_new_client_tools.py | Script to migrate CLM projects and activation keys from old to new client tools channels |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| # | ||
| # Using this script user can sync the client tools if they are not already synced for already mirrored products on SUSE Multi-Linux Manager and Uyuni. | ||
| # | ||
| # Releasmt.session: |
Copilot
AI
Oct 20, 2025
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.
Corrected spelling of 'Releasmt.session' to 'Release session'.
| # Releasmt.session: | |
| # Release session: |
| # | ||
| # Created by: Abid Mehmood | ||
| # | ||
| # Using this script user can update their actiavation keys and CLM projects by removing the old client tools and switching to new client tools. |
Copilot
AI
Oct 20, 2025
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.
Corrected spelling of 'actiavation' to 'activation'.
| # Using this script user can update their actiavation keys and CLM projects by removing the old client tools and switching to new client tools. | |
| # Using this script user can update their activation keys and CLM projects by removing the old client tools and switching to new client tools. |
| # Created by: Abid Mehmood | ||
| # | ||
| # Using this script user can update their actiavation keys and CLM projects by removing the old client tools and switching to new client tools. | ||
| # This script assumes that new client tools have been already syned in your SUSE Multi-Linux Manager and Uyuni instance. One can use sync_client_tools.py script to sync the new client tools. |
Copilot
AI
Oct 20, 2025
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.
Corrected spelling of 'syned' to 'synced'.
| # This script assumes that new client tools have been already syned in your SUSE Multi-Linux Manager and Uyuni instance. One can use sync_client_tools.py script to sync the new client tools. | |
| # This script assumes that new client tools have been already synced in your SUSE Multi-Linux Manager and Uyuni instance. One can use sync_client_tools.py script to sync the new client tools. |
| # Using this script user can update their actiavation keys and CLM projects by removing the old client tools and switching to new client tools. | ||
| # This script assumes that new client tools have been already syned in your SUSE Multi-Linux Manager and Uyuni instance. One can use sync_client_tools.py script to sync the new client tools. | ||
| # | ||
| # Releasmt.session: |
Copilot
AI
Oct 20, 2025
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.
Corrected spelling of 'Releasmt.session' to 'Release session'.
| # Releasmt.session: | |
| # Release session: |
|
|
||
| """ | ||
|
|
||
| #!/usr/bin/env python3 |
Copilot
AI
Oct 20, 2025
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.
The shebang line should be at the top of the file, not after the docstring. Move this line to line 1.
| # 2025-10-14 Abid - initial release. | ||
|
|
||
| """ | ||
| #!/usr/bin/env python3 |
Copilot
AI
Oct 20, 2025
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.
The shebang line should be at the top of the file, not after the docstring. Move this line to line 1.
| print(" No channels found.") | ||
| continue | ||
| for ch in channels: | ||
| if ch.get('family') == 'SLE-M-T' and ch.get('optional') != True: |
Copilot
AI
Oct 20, 2025
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.
Use 'is not True' instead of '!= True' for boolean comparisons, or better yet, use 'not ch.get('optional', False)' to handle None values properly.
| if ch.get('family') == 'SLE-M-T' and ch.get('optional') != True: | |
| if ch.get('family') == 'SLE-M-T' and not ch.get('optional', False): |
| log(f"No new client tools channel found for base channel {base_channel_label}. Skipping update for key {ak_key}.") | ||
| continue | ||
| else: | ||
| log(f"No old client tools channels found for key {ak_key}. Skipping update.") | ||
| continue |
Copilot
AI
Oct 20, 2025
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.
The indentation is inconsistent. Lines 204, 205, 207, and 208 should be indented one level further to align with the if-else block structure.
| log(f"No new client tools channel found for base channel {base_channel_label}. Skipping update for key {ak_key}.") | |
| continue | |
| else: | |
| log(f"No old client tools channels found for key {ak_key}. Skipping update.") | |
| continue | |
| log(f"No new client tools channel found for base channel {base_channel_label}. Skipping update for key {ak_key}.") | |
| continue | |
| else: | |
| log(f"No old client tools channels found for key {ak_key}. Skipping update.") | |
| continue |
Add a utility script to help migrating the activation keys and clm projects to new client tools.