Skip to content

sap_control_exec, sap_hostctrl_exec: QoL and Error handling#81

Merged
marcelmamula merged 1 commit into
sap-linuxlab:devfrom
marcelmamula:sapcontrol
Mar 13, 2026
Merged

sap_control_exec, sap_hostctrl_exec: QoL and Error handling#81
marcelmamula merged 1 commit into
sap-linuxlab:devfrom
marcelmamula:sapcontrol

Conversation

@marcelmamula

Copy link
Copy Markdown
Contributor

Changes

Following issues were found during recent pull requests and fixed in this PR:

  • Add validation of hostname to avoid soap failures
  • Add handling of changed_when to trigger only for functions were cannot be sure that changes occured. List of read only functions is defined in new constant READ_ONLY_FUNCTION_PREFIXES.
  • Add handling for force functions, because previously it was covering only Stop function which was not enough. New constants for filtering FORCE_REQUIRED_PREFIXES and FORCE_REQUIRED_EXACT.
  • New output parameters to make debugging simpler
    • connection_type
    • connection_url
  • Idempotent handling for 'Server raised fault: ''Instance already started''' when starting instances.
  • Improve clarity of use_local by changing it to is_socket_transport

Tests

Tested on SLES_SAP 16.0 running BW4HANA system.

Output Examples

Following output examples show changes to handling

    __start_instance_soap_sysnr:
        changed: false
        connection_type: socket
        connection_url: http://localhost/sapcontrol?wsdl
        error: ''
        failed: false
        msg: Function InstanceStart returned that Instance is already started.
        out:
        - null
    __getversioninfo_socket_port:
        changed: false
        connection_type: soap
        connection_url: http://localhost:50013/sapcontrol?wsdl
        error: ''
        failed: false
        msg: 'Successful execution of function: GetVersionInfo'
        out:
        -   item:
            -   Filename: /usr/sap/B01/ASCS00/exe/sapstartsrv
                Time: 2023 09 13 19:10:58
                VersionInfo: 793, patch 51, commit 375ae433dffb023985041c1d7b4687b1bde8d211,
                    RKS compatibility level 0, optU (Sep 13 2023, 20:37:54), linuxx86_64
fatal: [b01hana]: FAILED! =>
    changed: false
    connection_type: soap
    connection_url: http://b01hanax:50013/sapcontrol?wsdl
    error: <urlopen error [Errno -2] Name or service not known>
    msg: Function execution has failed. See error for more details.
    out: []
    __startinstance_socket:
        changed: true
        connection_type: socket
        connection_url: http://localhost/SAPHostControl/?wsdl
        error: ''
        failed: false
        msg: 'Successful execution of function: StartInstance'
        out:
        -   mOperationID: 8E3906D0F8DD1FD187C01EE68C59C000
            mOperationResults: ''

@marcelmamula marcelmamula self-assigned this Mar 12, 2026
@marcelmamula marcelmamula added the enhancement New feature or request label Mar 12, 2026
@marcelmamula

Copy link
Copy Markdown
Contributor Author

@ydouvry @nbttmbrg @sean-freeman This is collection of fixed for issues that I have detected during testing of last PR.
It would be great if you could test it out.

@sean-freeman sean-freeman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ydouvry

ydouvry commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Hello @marcelmamula !
We have successfully tested your plugins with integration tests.
Everything were OK, no issues, and the returned values were correct (expected ones + new ones).

Functions tested :

  • ListInstances
  • ParameterValue
  • GetVersionInfo
  • GetSystemInstanceList
  • Start / Stop / StartSystem / StopSystem

@marcelmamula marcelmamula merged commit 51aa82b into sap-linuxlab:dev Mar 13, 2026
29 checks passed
@marcelmamula

Copy link
Copy Markdown
Contributor Author

Thank you all @ydouvry @nbttmbrg @sean-freeman for checking and testing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants