From 1f7a760068a909c1f47cc75516ff022facc75da5 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Mon, 6 Nov 2023 12:27:11 -0500 Subject: [PATCH] Remove obsolete stx.conf upgrade Remove code that automagically changes debian archive URLs in stx.conf to public WR mirror URLs. This upgrade was added last year and was only relevant to un-upgraded development environments that existed at that time (eg on developer desktops). It is no longer relevant. Removing it because it breaks the ability of the user to explicitly set those URLs to the real Debian archive repository under some circumstances. How to reproduce: * Remove existing stx.conf * Copy stx.conf.example => stx.conf * Replace the key: stx config --add stx config --add project.debian_snapshot_base http://snapshot.debian.org/archive/debian * Upgreade configuration: stx config --upgrade * ===> URL gets reset back to default (mirror) in stx.conf TESTS ================================== * Re-run above steps and make sure this doesn't happen Closes-Bug: 2042854 Signed-off-by: Davlet Panech Change-Id: I3ff011d747f2804ade0152ad0296b00ba2785ebf --- stx/lib/stx/stx_configparser.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/stx/lib/stx/stx_configparser.py b/stx/lib/stx/stx_configparser.py index d9176b9e..a1678c41 100644 --- a/stx/lib/stx/stx_configparser.py +++ b/stx/lib/stx/stx_configparser.py @@ -218,16 +218,14 @@ class STXConfigParser: if not self.__upgrade_id_exists('debian_snapshot_stx_mirror'): debian_snapshot_stx_mirror_upgraded = False # debian_snapshot_base - old_value = 'http://snapshot.debian.org/archive/debian' - old_value2 = 'http://mirror.starlingx.cengn.ca/mirror/debian/debian/snapshot.debian.org/archive/debian' + old_value = 'http://mirror.starlingx.cengn.ca/mirror/debian/debian/snapshot.debian.org/archive/debian' new_value = 'https://mirror.starlingx.windriver.com/mirror/debian/debian/snapshot.debian.org/archive/debian' current_value = self.__get('project', 'debian_snapshot_base') - if current_value == old_value or current_value == old_value2: + if current_value == old_value: self.__upgrade_nonempty_key('project', 'debian_snapshot_base', new_value) debian_snapshot_stx_mirror_upgraded = True # debian_security_snapshot_base - old_value = 'http://snapshot.debian.org/archive/debian-security' - old_value2 = 'http://mirror.starlingx.cengn.ca/mirror/debian/debian/snapshot.debian.org/archive/debian-security' + old_value = 'http://mirror.starlingx.cengn.ca/mirror/debian/debian/snapshot.debian.org/archive/debian-security' new_value = 'https://mirror.starlingx.windriver.com/mirror/debian/debian/snapshot.debian.org/archive/debian-security' current_value = self.__get('project', 'debian_security_snapshot_base') if current_value == old_value: