Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Set, List
from typing import Dict, Set, List, Tuple
Comment thread
github-code-quality[bot] marked this conversation as resolved.
Fixed
Comment thread
srbarrios marked this conversation as resolved.
Outdated

# Import the shared client tools from 5.1 for non-beta usage
from .v51_nodes import (
Expand All @@ -8,21 +8,26 @@
)

# --- NON-BETA 5.2 REPOSITORIES ---
v52_uyuni_tools_sles_repos: Dict[str, Set[str]] = {
"server" : {"/SUSE_Updates_Multi-Linux-Manager-Server-SLE_5.2_x86_64/",
"/SUSE_Updates_SLE-Module-Server-Applications_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Basesystem_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Containers_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Python3_15-SP7_x86_64/"},
"proxy" : { "/SUSE_Updates_Multi-Linux-Manager-Proxy-SLE_5.2_x86_64/",
"/SUSE_Updates_Multi-Linux-Manager-Retail-Branch-Server-SLE_5.2_x86_64/",
"/SUSE_Updates_MultiLinuxManagerTools_SLE-15_x86_64/",
"/SUSE_Updates_SLE-Module-Server-Applications_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Basesystem_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Containers_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Python3_15-SP7_x86_64/"},
v52_uyuni_tools_sles_repos: Dict[str, Dict[str, str]] = {
"server": {
"server_uyuni_tools": "/SUSE_Updates_Multi-Linux-Manager-Server-SLE_5.2_x86_64/",
Comment thread
srbarrios marked this conversation as resolved.
Outdated
"server_applications": "/SUSE_Updates_SLE-Module-Server-Applications_15-SP7_x86_64/",
"basesystem": "/SUSE_Updates_SLE-Module-Basesystem_15-SP7_x86_64/",
"containers": "/SUSE_Updates_SLE-Module-Containers_15-SP7_x86_64/",
"python3": "/SUSE_Updates_SLE-Module-Python3_15-SP7_x86_64/"
},
"proxy": {
"proxy_uyuni_tools": "/SUSE_Updates_Multi-Linux-Manager-Proxy-SLE_5.2_x86_64/",
"retail_uyuni_tools": "/SUSE_Updates_Multi-Linux-Manager-Retail-Branch-Server-SLE_5.2_x86_64/",
"sle15_client_tools": "/SUSE_Updates_MultiLinuxManagerTools_SLE-15_x86_64/",
"server_applications": "/SUSE_Updates_SLE-Module-Server-Applications_15-SP7_x86_64/",
"basesystem": "/SUSE_Updates_SLE-Module-Basesystem_15-SP7_x86_64/",
"containers": "/SUSE_Updates_SLE-Module-Containers_15-SP7_x86_64/",
"python3": "/SUSE_Updates_SLE-Module-Python3_15-SP7_x86_64/"
}
}

# TODO: To be confirmed
v52_uyuni_tools_micro_repos: Dict[str, Dict[str, str]] = {
"server": {
"server_uyuni_tools": "/SLFO:/Products:/Multi-Linux-Manager:/5.2:/ToTest/product/repo/Multi-Linux-Manager-Server-5.2-x86_64/"},
Expand All @@ -34,19 +39,13 @@
}

# --- BETA 5.2 REPOSITORIES ---
v52_uyuni_tools_sles_repos_beta: Dict[str, Set[str]] = {
"server" : {"/SUSE_Updates_Multi-Linux-Manager-Server-SLE_5.2_x86_64/",
"/SUSE_Updates_SLE-Module-Server-Applications_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Basesystem_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Containers_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Python3_15-SP7_x86_64/"},
"proxy" : { "/SUSE_Updates_Multi-Linux-Manager-Proxy-SLE_5.2_x86_64/",
"/SUSE_Updates_Multi-Linux-Manager-Retail-Branch-Server-SLE_5.2_x86_64/",
"/SUSE_Updates_MultiLinuxManagerTools-Beta_SLE-15_x86_64/",
"/SUSE_Updates_SLE-Module-Server-Applications_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Basesystem_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Containers_15-SP7_x86_64/",
"/SUSE_Updates_SLE-Module-Python3_15-SP7_x86_64/"},
v52_uyuni_tools_sles_repos_beta: Dict[str, Dict[str, str]] = {
"server": {
"server_uyuni_tools": "/SLE-15-SP7:/Update:/Products:/MultiLinuxManager52:/ToTest/images-SP7/repo/SUSE-Multi-Linux-Manager-Server-SLE-5.2-POOL-x86_64-Media1/"},
"proxy": {
"proxy_uyuni_tools": "/SLE-15-SP7:/Update:/Products:/MultiLinuxManager52:/ToTest/images-SP7/repo/SUSE-Multi-Linux-Manager-Proxy-SLE-5.2-POOL-x86_64-Media1/",
"retail_uyuni_tools": "/SLE-15-SP7:/Update:/Products:/MultiLinuxManager52:/ToTest/images-SP7/repo/SUSE-Multi-Linux-Manager-Retail-Branch-Server-SLE-5.2-POOL-x86_64-Media1/"
Comment thread
srbarrios marked this conversation as resolved.
Outdated
}
}

v52_uyuni_tools_micro_repos_beta: Dict[str, Dict[str, str]] = {
Expand Down Expand Up @@ -106,7 +105,7 @@
"slemicro55_minion": { "/SUSE_Updates_MultiLinuxManagerTools-Beta_SLE-Micro-5_x86_64/" }
}

def get_v52_static_and_client_tools(variant: str = "micro", beta: bool = False) -> (Dict[str, Dict[str, str]], Dict[str, List[str]]):
def get_v52_static_and_client_tools(variant: str = "micro", beta: bool = False) -> Tuple[Dict[str, Dict[str, str]], Dict[str, Set[str]]]:
# Determine the sources to map based on the beta flag
if beta:
source_static_repos = v52_nodes_static_client_tools_repositories_beta
Expand All @@ -130,20 +129,23 @@ def get_v52_static_and_client_tools(variant: str = "micro", beta: bool = False)

if variant == "micro":
uyuni_tools = source_micro_repos
for key in ("server", "proxy"):
if key not in static_repos:
static_repos[key] = {}
for name, path in uyuni_tools.get(key, {}).items():
static_repos[key][name] = f"{IBS_URL_PREFIX}{path}"

elif variant == "sles":
uyuni_tools = source_sles_repos
for key in ("server", "proxy"):
if key not in dynamic_maintenance_repos:
dynamic_maintenance_repos[key] = set()
for path in uyuni_tools.get(key, set()):
dynamic_maintenance_repos[key].add(path)
else:
raise ValueError(f"Invalid variant '{variant}'. Choose from: 'micro', 'sles'")

for key in ("server", "proxy"):
if key not in dynamic_maintenance_repos:
dynamic_maintenance_repos[key] = set()
if key not in static_repos:
static_repos[key] = {}

repos = uyuni_tools.get(key, {})

for name, path in repos.items():
if "SUSE_Updates_" in path:
Comment thread
srbarrios marked this conversation as resolved.
Outdated
dynamic_maintenance_repos[key].add(path)
else:
static_repos[key][name] = f"{IBS_URL_PREFIX}{path}"

return static_repos, dynamic_maintenance_repos
Loading