Skip to content

Commit 157027e

Browse files
authored
Merge pull request #42 from sap-linuxlab/dev
merge dev to main for release 1.2.1
2 parents 9378a71 + 0b3c300 commit 157027e

File tree

6 files changed

+55
-15
lines changed

6 files changed

+55
-15
lines changed

CHANGELOG.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ community.sap\_launchpad Release Notes
44

55
.. contents:: Topics
66

7+
v1.2.1
8+
======
9+
10+
Release Summary
11+
---------------
12+
13+
Various bug fixes
14+
15+
Bugfixes
16+
--------
17+
- software_center_download: Improved logic for skipping existing files and getting valid filename (https://github.com/sap-linuxlab/community.sap_launchpad/pull/40)
18+
- sap_software_download: Add SLES 16 python313 support and update changelog (https://github.com/sap-linuxlab/community.sap_launchpad/pull/41)
19+
20+
721
v1.2.0
822
======
923

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace: community
88
name: sap_launchpad
99

1010
# The version of the collection. Must be compatible with semantic versioning
11-
version: 1.2.0
11+
version: 1.2.1
1212

1313
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1414
readme: README.md

plugins/module_utils/sap_launchpad_software_center_download_runner.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ def _get_valid_filename(software_found):
313313
"""
314314

315315
# Check if Title contains filename and extension
316-
if re.match(r'^[^/\\\0]+\.[^/\\\0]+$', software_found['Title']):
317-
return software_found['Title']
318-
else:
319-
# Check if Description contains filename and extension
320-
if re.match(r'^[^/\\\0]+\.[^/\\\0]+$', software_found['Description']):
316+
if re.match(r'^\d+$', software_found['Title']):
317+
# Check if Description attribute exists and that it does not contain empty spaces
318+
if software_found['Description'] and ' ' not in software_found['Description']:
321319
return software_found['Description']
322320
else:
323-
# Default to Title if Description does not help
324321
return software_found['Title']
322+
else:
323+
# Default to Title if Description does not help
324+
return software_found['Title']

plugins/modules/software_center_download.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,15 @@ def _check_similar_files(dest, filename):
128128
bool: True if similar files exist, False otherwise.
129129
filename_similar_names: A list of similar filenames if they exist, empty list otherwise.
130130
"""
131-
# pattern = dest + '/**/' + os.path.splitext(filename)[0]
132-
filename_base = os.path.splitext(filename)[0]
133-
filename_pattern = os.path.join(dest, "**", filename_base)
131+
132+
# Check if filename has has extension and remove it for search
133+
if os.path.splitext(filename)[1]:
134+
filename_base = os.path.splitext(filename)[0]
135+
filename_pattern = os.path.join(dest, "**", filename_base + ".*")
136+
else:
137+
filename_pattern = os.path.join(dest, "**", filename + ".*")
138+
139+
# Find all similar files in dest and sub-folders.
134140
filename_similar = glob.glob(filename_pattern, recursive=True)
135141

136142
if filename_similar:
@@ -217,7 +223,7 @@ def run_module():
217223
else:
218224
# Exact file not found, search for similar files with pattern
219225
filename_similar_exists, filename_similar_names = _check_similar_files(dest, filename)
220-
if filename_similar_exists and not (query and search_alternatives):
226+
if filename_similar_exists:
221227
result['skipped'] = True
222228
result['msg'] = f"Similar file(s) already exist: {', '.join(filename_similar_names)}"
223229
module.exit_json(**result)

roles/sap_software_download/vars/Suse.yml renamed to roles/sap_software_download/vars/SLES_15.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33

44
# Variables specific to following versions:
55
# - SUSE Linux Enterprise Server 15
6-
# - SUSE Linux Enterprise Server 16
76

87
# NOTE: SLES 15 SP5 introduced Python 3.11.
98

109
# Set which Python version will be used on destination node.
1110
# This is python executable name, which can differ from python package name.
1211
__sap_software_download_python_interpreter: >-
13-
{%- if ansible_distribution_major_version == '15' and ansible_distribution_version.split('.')[1] | int < 5 -%}
12+
{%- if ansible_distribution_version.split('.')[1] | int < 5 -%}
1413
python3
1514
{%- else -%}
1615
python3.11
1716
{%- endif -%}
1817
1918
# Set which Python package will be installed on destination node.
2019
__sap_software_download_python_package: >-
21-
{%- if ansible_distribution_major_version == '15' and ansible_distribution_version.split('.')[1] | int < 5 -%}
20+
{%- if ansible_distribution_version.split('.')[1] | int < 5 -%}
2221
python3
2322
{%- else -%}
2423
python311
@@ -27,7 +26,7 @@ __sap_software_download_python_package: >-
2726
# The list of required Python Modules in packages
2827
# This is required in order to avoid externally-managed-environment error.
2928
__sap_software_download_python_module_packages: >-
30-
{%- if ansible_distribution_major_version == '15' and ansible_distribution_version.split('.')[1] | int < 5 -%}
29+
{%- if ansible_distribution_version.split('.')[1] | int < 5 -%}
3130
[
3231
"python3-wheel",
3332
"python3-urllib3",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
---
3+
4+
# Variables specific to following versions:
5+
# - SUSE Linux Enterprise Server 16
6+
7+
# Set which Python version will be used on destination node.
8+
# This is python executable name, which can differ from python package name.
9+
__sap_software_download_python_interpreter: python3.13
10+
11+
# Set which Python package will be installed on destination node.
12+
__sap_software_download_python_package: python313
13+
14+
# The list of required Python Modules in packages
15+
# This is required in order to avoid externally-managed-environment error.
16+
__sap_software_download_python_module_packages:
17+
- "python313-wheel"
18+
- "python313-urllib3"
19+
- "python313-requests"
20+
- "python313-beautifulsoup4"
21+
- "python313-lxml"

0 commit comments

Comments
 (0)