Skip to content

Commit

Permalink
fix(get_all_versions_from_centos_repository): limit only to scylla pa…
Browse files Browse the repository at this point in the history
…ckages

since now scylla-doctor was introduced into scylla repositories
we don't want to retrive it's version, only the scylla versions

if and when we'll need to get it's version, we'll need to refactor
this code to supply list of package we'll want to look at.
  • Loading branch information
fruch committed Sep 10, 2024
1 parent e31af01 commit 7cf3f2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdcm/utils/version_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
LATEST_SYMLINK_NAME = "latest"
NO_TIMESTAMP = dateutil.parser.parse("1961-04-12T06:07:00Z", ignoretz=True) # Poyekhali!

SUPPORTED_PACKAGES = ("scylla", "scylla-enterprise", "scylla-manager")

LOGGER = logging.getLogger(__name__)


Expand Down Expand Up @@ -359,7 +361,8 @@ def get_version(url: str) -> set[str]:
xml_url = url.replace(REPOMD_XML_PATH, primary_path)

parser = Parser(url=xml_url)
major_versions = [package['version'][1]['ver'] for package in parser.getList()]
major_versions = [package['version'][1]['ver']
for package in parser.getList() if package['name'][0] in SUPPORTED_PACKAGES]
return set(major_versions)

threads = ParallelObject(objects=urls, timeout=SCYLLA_URL_RESPONSE_TIMEOUT).run(func=get_version)
Expand Down
6 changes: 6 additions & 0 deletions unit_tests/test_base_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ def test_2024_2(self):
version_list = general_test(scylla_repo, linux_distro)
assert set(version_list) == {'6.0', '2024.1'}

def test_2024_2_ubuntu(self):
scylla_repo = self.url_base + '-enterprise/enterprise-2024.2/deb/unified/latest/scylladb-2024.2/scylla.list'
linux_distro = 'ubuntu-focal'
version_list = general_test(scylla_repo, linux_distro)
assert set(version_list) == {'6.0', '2024.1'}


if __name__ == "__main__":
unittest.main()

0 comments on commit 7cf3f2d

Please sign in to comment.