Skip to content
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

Mergeback to dev #37

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
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
64 changes: 26 additions & 38 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ jobs:
strategy:
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
runs-on: ubuntu-latest
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- devel

runs-on: >-
${{ contains(fromJson(
'["stable-2.13", "stable-2.14"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
steps:

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Perform sanity testing with ansible-test
uses: ansible-community/ansible-test-gh-action@release/v1
Expand All @@ -36,52 +41,35 @@ jobs:


units:
runs-on: ubuntu-latest
runs-on: >-
${{ contains(fromJson(
'["stable-2.13", "stable-2.14"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
name: Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
# As soon as the first unit test fails, cancel the others to free up the CI queue
fail-fast: true
matrix:
ansible:
- stable-2.9 # Only if your collection supports Ansible 2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
python:
- 2.6
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
exclude:
# Because ansible-test doesn't support python3.9 for Ansible 2.9
- ansible: stable-2.9
python: 3.9
- ansible: stable-2.13
python: 2.6
include:
# Test Devel on Python 3.10 only
- ansible: devel
python: '3.10'

- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- devel

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Perform unit testing with ansible-test
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
target-python-version: ${{ matrix.python }}
python-version: '3.10'
testing-type: units
test-deps: >-
ansible.netcommon
ansible.utils
# test-deps: >-
# ansible.netcommon
# ansible.utils

# Please consult the Readme for information on why we disabled integration tests temporarily.

Expand Down Expand Up @@ -115,7 +103,7 @@ jobs:

# steps:
# - name: Check out code
# uses: actions/checkout@v2
# uses: actions/checkout@v3

# - name: Perform integration testing with ansible-test
# uses: ansible-community/ansible-test-gh-action@release/v1
Expand All @@ -129,4 +117,4 @@ jobs:
# testing-type: integration
# test-deps: >-
# ansible.netcommon
# ansible.utils
# ansible.utils
36 changes: 35 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@ Community SAP Release Notes
.. contents:: Topics


v1.3.0
v1.4.1
======

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

This is the 1.4.1 patch release of the ``community.sap_libs`` collection.
This changelog contains all changes to the modules and plugins in this collection
that have been made after the previous release.

Bugfixes
--------

- fixes failures in sanity test for plugins/modules/sap_pyrfc.py
- fixes failures in sanity test for tests/unit/compat/builtins.py
- fixes failures in sanity test for tests/unit/plugins/modules/test_sap_system_facts.py
- fixes failures in sanity test for tests/unit/plugins/modules/test_sap_system_facts.py
- fixes pipeline warnings
- sapcontrol_exec - This pr fixes problems on c(StartSystem), c(StopSystem), c(RestartSystem) which needs parameters they ca not provided by the parameters argument because of special format like c(waittimeout=1) without string quotes. This is caused by the suds module itself.

v1.4.0
======

Release Summary
Expand All @@ -15,6 +35,20 @@ This is the 1.3.0 minor release of the ``community.sap_libs`` collection.
This changelog contains all changes to the modules and plugins in this collection
that have been made after the previous release.

Bugfixes
--------

- fix a bug where some commands produces no output which cause to crash the module.
- modules - fix a "variable used before assignment" that cannot be reached but causes sanity test failures.

v1.3.0
======

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

This is the 1.3.0 minor release of the ``community.sap_libs`` collection. This changelog contains all changes to the modules and plugins in this collection that have been made after the previous release.

Minor Changes
-------------

Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,27 @@ Every voice is important. If you have something on your mind, create an issue or
## Tested with Ansible and the following Python versions

Tested Ansible versions:
- 2.9
- 2.10
- 2.11
- 2.12
- 2.13
- 2.14
- 2.15
- 2.16
- devel

Tested Python versions:
- 2.6
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11

Due to SAP licensing and hardware requirements, integration tests are momentarily not feasible.
The modules are tested manually against SAP systems until we found a solution or have some
modules where we are able to execute integration test we decided to disable these tests.

The test support for Ansible versions 2.9 - 2.12 is disabled due to eol of these versions.
The modules may work with these versions but are not tested.

## External requirements

For some modules the below requirements are needed on the host that executes a module.
Expand All @@ -99,14 +100,14 @@ For some modules the below requirements are needed on the host that executes a m
## Included content

- **Modules**:
- [sap_hdbsql](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_hdbsql.html)
- [sap_task_list_execute](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_task_list_execute.html)
- [sapcar_extract](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sapcar_extract.html)
- [sap_company](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_company.html)
- [sap_snote](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_snote.html)
- [sap_user](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_user.html)
- [sap_system_facts](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_system_facts.html)
- [sap_control_exec](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_control_exec.html)
- [sap_hdbsql](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_hdbsql_module.html)
- [sap_task_list_execute](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_task_list_execute_module.html)
- [sapcar_extract](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sapcar_extract_module.html)
- [sap_company](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_company_module.html)
- [sap_snote](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_snote_module.html)
- [sap_user](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_user_module.html)
- [sap_system_facts](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_system_facts_module.html)
- [sap_control_exec](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_control_exec_module.html)

## Using this collection

Expand Down
51 changes: 48 additions & 3 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,63 @@ releases:
release_date: '2022-07-18'
1.3.0:
changes:
breaking_changes:
minor_changes:
- License requirements are updated.
- The modules purposes are described clearer.
- The namespaces of the modules are removed to provide a flatter design.
- hana_query - module is moved to sap_hdbsql.
- sapcontrol - module is moved to sap_control_exec to have a clearer separation
to other roles and references.
release_summary: This is the 1.3.0 minor release of the ``community.sap_libs``
collection. This changelog contains all changes to the modules and plugins
in this collection that have been made after the previous release.
fragments:
- 1.3.0.yml
release_date: '2022-09-09'
1.4.0:
changes:
bugfixes:
- fix a bug where some commands produces no output which cause to crash the
module.
- modules - fix a "variable used before assignment" that cannot be reached but
causes sanity test failures.
release_summary: 'This is the 1.3.0 minor release of the ``community.sap_libs``
collection.

This changelog contains all changes to the modules and plugins in this collection

that have been made after the previous release.'
fragments:
- 1.3.0.yml
release_date: '2022-09-09'
- 0020-fix_sap_control_exec.yml
- 1.4.0.yml
- 22-use-before-assignment.yml
release_date: '2022-12-05'
1.4.1:
changes:
bugfixes:
- fixes failures in sanity test for plugins/modules/sap_pyrfc.py
- fixes failures in sanity test for tests/unit/compat/builtins.py
- fixes failures in sanity test for tests/unit/plugins/modules/test_sap_system_facts.py
- fixes failures in sanity test for tests/unit/plugins/modules/test_sap_system_facts.py
- fixes pipeline warnings
- sapcontrol_exec - This pr fixes problems on c(StartSystem), c(StopSystem),
c(RestartSystem) which needs parameters they ca not provided by the parameters
argument because of special format like c(waittimeout=1) without string quotes.
This is caused by the suds module itself.
release_summary: This is the 1.4.1 patch release of the ``community.sap_libs``
collection. This changelog contains all changes to the modules and plugins
in this collection that have been made after the previous release.
fragments:
- 28-fix-sapcontrol-issue.yml
- 29-fix-lint-issues.yml
release_date: '2023-03-09'
1.4.2:
changes:
bugfixes:
- fixes failures in sanity test for all modules
release_summary: This is the 1.4.2 patch release of the ``community.sap_libs``
collection. This changelog contains all changes to the modules and plugins
in this collection that have been made after the previous release.
fragments:
- 30-fix-lint-issues.yml
release_date: '2024-23-01'
5 changes: 5 additions & 0 deletions changelogs/fragments/0043-Ansible_eol_support_drop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minor_changes:
- Drop support for ansible <= 2.12
- Add test for ansible 2.18 aka devel
bugfixes:
- Fix pipelines
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Add -E 3 Option to hdbsql run, if filepaht is selected, to fail on first sql error
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace: community
name: sap_libs
version: 1.3.0
version: 1.4.2
readme: README.md
authors:
- Rainer Leber (github.com/rainerleber)
Expand Down
3 changes: 3 additions & 0 deletions plugins/module_utils/swpm2_parameters_inifile_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def control_xml_utf8(filepath, module):
string = etree.tostring(root, xml_declaration=True, encoding="UTF-8",
pretty_print=True).decode('utf8').encode('iso-8859-1')

# string1 = etree.tostring(root, xml_declaration=True, encoding="UTF-8",
# pretty_print=True).decode('utf8').encode('utf-8').strip()

with open('control_utf8.xml', 'wb') as target:
target.write(string)

Expand Down
1 change: 1 addition & 0 deletions plugins/modules/sap_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
HAS_PYRFC_LIBRARY = False
ANOTHER_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
ANOTHER_LIBRARY_IMPORT_ERROR = None
HAS_PYRFC_LIBRARY = True


Expand Down
10 changes: 9 additions & 1 deletion plugins/modules/sap_control_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
HAS_SUDS_LIBRARY = False
SUDS_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
SUDS_LIBRARY_IMPORT_ERROR = None
HAS_SUDS_LIBRARY = True


Expand Down Expand Up @@ -323,6 +324,10 @@ def connection(hostname, port, username, password, function, parameter):
_function = getattr(client.service, function)
if parameter is not None:
result = _function(parameter)
elif function == "StartSystem":
result = _function(waittimeout=0)
elif function == "StopSystem" or function == "RestartSystem":
result = _function(waittimeout=0, softtimeout=0)
else:
result = _function()

Expand Down Expand Up @@ -384,7 +389,10 @@ def main():
result['msg'] = 'Something went wrong connecting to the SAPCONTROL SOAP API.'
module.fail_json(**result)

returned_data = recursive_dict(conn)
if conn is not None:
returned_data = recursive_dict(conn)
else:
returned_data = conn

result['changed'] = True
result['msg'] = "Succesful execution of: " + function
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/sap_hdbsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def main():
command.extend(['-x', '-i', instance, '-u', user, '-p', password])

if filepath is not None:
command.extend(['-I'])
command.extend(['-E 3', '-I'])
for p in filepath:
# makes a command like hdbsql -i 01 -u SYSTEM -p secret123# -I /tmp/HANA_CPU_UtilizationPerCore_2.00.020+.txt,
# iterates through files and append the output to var out.
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/sap_pyrfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@
from ..module_utils.pyrfc_handler import get_connection

try:
from pyrfc import ABAPApplicationError, ABAPRuntimeError, CommunicationError, Connection, LogonError
from pyrfc import ABAPApplicationError, ABAPRuntimeError, CommunicationError, LogonError
except ImportError:
HAS_PYRFC_LIBRARY = False
PYRFC_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
PYRFC_LIBRARY_IMPORT_ERROR = None
HAS_PYRFC_LIBRARY = True


Expand Down Expand Up @@ -162,6 +163,7 @@ def main():
try:
conn = get_connection(module, conn_params)
result = conn.call(function, **func_params)
error_msg = None
except CommunicationError as err:
msg = "Could not connect to server"
error_msg = err.message
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/sap_snote.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
HAS_PYRFC_LIBRARY = False
ANOTHER_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
ANOTHER_LIBRARY_IMPORT_ERROR = None
HAS_PYRFC_LIBRARY = True


Expand Down
Loading
Loading