Skip to content

merge dev to main for release 1.2.1 #42

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

Merged
merged 5 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ community.sap\_launchpad Release Notes

.. contents:: Topics

v1.2.1
======

Release Summary
---------------

Various bug fixes

Bugfixes
--------
- software_center_download: Improved logic for skipping existing files and getting valid filename (https://github.com/sap-linuxlab/community.sap_launchpad/pull/40)
- sap_software_download: Add SLES 16 python313 support and update changelog (https://github.com/sap-linuxlab/community.sap_launchpad/pull/41)


v1.2.0
======

Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: community
name: sap_launchpad

# The version of the collection. Must be compatible with semantic versioning
version: 1.2.0
version: 1.2.1

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ def _get_valid_filename(software_found):
"""

# Check if Title contains filename and extension
if re.match(r'^[^/\\\0]+\.[^/\\\0]+$', software_found['Title']):
return software_found['Title']
else:
# Check if Description contains filename and extension
if re.match(r'^[^/\\\0]+\.[^/\\\0]+$', software_found['Description']):
if re.match(r'^\d+$', software_found['Title']):
# Check if Description attribute exists and that it does not contain empty spaces
if software_found['Description'] and ' ' not in software_found['Description']:
return software_found['Description']
else:
# Default to Title if Description does not help
return software_found['Title']
else:
# Default to Title if Description does not help
return software_found['Title']
14 changes: 10 additions & 4 deletions plugins/modules/software_center_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ def _check_similar_files(dest, filename):
bool: True if similar files exist, False otherwise.
filename_similar_names: A list of similar filenames if they exist, empty list otherwise.
"""
# pattern = dest + '/**/' + os.path.splitext(filename)[0]
filename_base = os.path.splitext(filename)[0]
filename_pattern = os.path.join(dest, "**", filename_base)

# Check if filename has has extension and remove it for search
if os.path.splitext(filename)[1]:
filename_base = os.path.splitext(filename)[0]
filename_pattern = os.path.join(dest, "**", filename_base + ".*")
else:
filename_pattern = os.path.join(dest, "**", filename + ".*")

# Find all similar files in dest and sub-folders.
filename_similar = glob.glob(filename_pattern, recursive=True)

if filename_similar:
Expand Down Expand Up @@ -217,7 +223,7 @@ def run_module():
else:
# Exact file not found, search for similar files with pattern
filename_similar_exists, filename_similar_names = _check_similar_files(dest, filename)
if filename_similar_exists and not (query and search_alternatives):
if filename_similar_exists:
result['skipped'] = True
result['msg'] = f"Similar file(s) already exist: {', '.join(filename_similar_names)}"
module.exit_json(**result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@

# Variables specific to following versions:
# - SUSE Linux Enterprise Server 15
# - SUSE Linux Enterprise Server 16

# NOTE: SLES 15 SP5 introduced Python 3.11.

# Set which Python version will be used on destination node.
# This is python executable name, which can differ from python package name.
__sap_software_download_python_interpreter: >-
{%- if ansible_distribution_major_version == '15' and ansible_distribution_version.split('.')[1] | int < 5 -%}
{%- if ansible_distribution_version.split('.')[1] | int < 5 -%}
python3
{%- else -%}
python3.11
{%- endif -%}

# Set which Python package will be installed on destination node.
__sap_software_download_python_package: >-
{%- if ansible_distribution_major_version == '15' and ansible_distribution_version.split('.')[1] | int < 5 -%}
{%- if ansible_distribution_version.split('.')[1] | int < 5 -%}
python3
{%- else -%}
python311
Expand All @@ -27,7 +26,7 @@ __sap_software_download_python_package: >-
# The list of required Python Modules in packages
# This is required in order to avoid externally-managed-environment error.
__sap_software_download_python_module_packages: >-
{%- if ansible_distribution_major_version == '15' and ansible_distribution_version.split('.')[1] | int < 5 -%}
{%- if ansible_distribution_version.split('.')[1] | int < 5 -%}
[
"python3-wheel",
"python3-urllib3",
Expand Down
21 changes: 21 additions & 0 deletions roles/sap_software_download/vars/SLES_16.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: Apache-2.0
---

# Variables specific to following versions:
# - SUSE Linux Enterprise Server 16

# Set which Python version will be used on destination node.
# This is python executable name, which can differ from python package name.
__sap_software_download_python_interpreter: python3.13

# Set which Python package will be installed on destination node.
__sap_software_download_python_package: python313

# The list of required Python Modules in packages
# This is required in order to avoid externally-managed-environment error.
__sap_software_download_python_module_packages:
- "python313-wheel"
- "python313-urllib3"
- "python313-requests"
- "python313-beautifulsoup4"
- "python313-lxml"