Skip to content

Conversation

@admd
Copy link

@admd admd commented Oct 14, 2025

Add a utility script to help migrating the activation keys and clm projects to new client tools.

  • sync_client_tools -> to sync the unsynced client tools channels for already mirrored products
  • migrate_to_new_client_tools -> to update clm projects and activation keys to the new client tools channels.

@admd admd requested a review from a team as a code owner October 14, 2025 11:04
@admd admd requested review from mcalmer and removed request for a team October 14, 2025 11:07
@admd admd force-pushed the script-to-switch-to-new-client-tools branch from 5bce18a to 4698987 Compare October 14, 2025 11:35
@admd admd changed the title Add a utility script to switch to new client tools Add a utility scripts to switch to new client tools Oct 15, 2025
@admd admd force-pushed the script-to-switch-to-new-client-tools branch 3 times, most recently from 70b7958 to bee222a Compare October 16, 2025 17:31
@@ -0,0 +1,308 @@
"""
# (c) 2019 SUSE Linux GmbH, Germany.
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
main()
main()

A newline is missing at the end.

@nodeg nodeg requested a review from Copilot October 20, 2025 09:50
Copy link

Copilot AI left a 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.py to sync unsynced client tools channels for already mirrored products
  • Adds migrate_to_new_client_tools.py to 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:
Copy link

Copilot AI Oct 20, 2025

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'.

Suggested change
# Releasmt.session:
# Release session:

Copilot uses AI. Check for mistakes.
#
# 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.
Copy link

Copilot AI Oct 20, 2025

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'.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
# 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.
Copy link

Copilot AI Oct 20, 2025

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'.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
# 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:
Copy link

Copilot AI Oct 20, 2025

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'.

Suggested change
# Releasmt.session:
# Release session:

Copilot uses AI. Check for mistakes.

"""

#!/usr/bin/env python3
Copy link

Copilot AI Oct 20, 2025

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.

Copilot uses AI. Check for mistakes.
# 2025-10-14 Abid - initial release.

"""
#!/usr/bin/env python3
Copy link

Copilot AI Oct 20, 2025

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.

Copilot uses AI. Check for mistakes.
print(" No channels found.")
continue
for ch in channels:
if ch.get('family') == 'SLE-M-T' and ch.get('optional') != True:
Copy link

Copilot AI Oct 20, 2025

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.

Suggested change
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):

Copilot uses AI. Check for mistakes.
Comment on lines +204 to +208
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
Copy link

Copilot AI Oct 20, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants