Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2023-08-01 14:15:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.32662 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "salt-shaptools" Tue Aug 1 14:15:52 2023 rev:25 rq:1101541 version:0.3.18+git.1690200022.db379c1 Changes: -------- --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2021-06-04 00:34:23.381014042 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.32662/salt-shaptools.changes 2023-08-01 14:15:54.175619127 +0200 @@ -1,0 +2,45 @@ +Tue Jul 11 15:03:17 UTC 2023 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.18 + * Salt no longer vendors six (>=salt-3006.0) + https://github.com/saltstack/salt/issues/63874 + +------------------------------------------------------------------- +Fri Apr 28 08:55:32 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.17 + * add HANA add_hosts feature + +------------------------------------------------------------------- +Fri Apr 19 14:04:54 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.16 + * store crm state in __context__ instead of __salt__ + +------------------------------------------------------------------- +Fri Mar 18 15:02:13 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.15 + * workaround to detect aws cloud_provider + details https://github.com/SUSE/ha-sap-terraform-deployments/issues/832 + until https://github.com/ClusterLabs/crmsh/pull/952 is available + +------------------------------------------------------------------- +Wed Feb 2 16:36:27 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.14 + * do not raise exception on empty HANA query results + +------------------------------------------------------------------- +Thu Jan 20 13:37:10 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.13 + * Add module query to HANA + +------------------------------------------------------------------- +Wed Jul 21 07:55:12 UTC 2021 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.12 + * Fix typo to fix uninstalled state + +------------------------------------------------------------------- Old: ---- salt-shaptools-0.3.11+git.1622732434.835d199.tar.gz New: ---- salt-shaptools-0.3.18+git.1690200022.db379c1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ salt-shaptools.spec ++++++ --- /var/tmp/diff_new_pack.IhSwsk/_old 2023-08-01 14:15:56.575633225 +0200 +++ /var/tmp/diff_new_pack.IhSwsk/_new 2023-08-01 14:15:56.579633249 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version: 0.3.11+git.1622732434.835d199 +Version: 0.3.18+git.1690200022.db379c1 Release: 0 Summary: Salt modules and states for SAP Applications and SLE-HA components management @@ -28,6 +28,11 @@ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +%if 0%{?suse_version} >= 1500 +Requires: python3-six +%else +Requires: python-six +%endif %description Salt modules and states for SAP Applications and SLE-HA components management ++++++ _service ++++++ --- /var/tmp/diff_new_pack.IhSwsk/_old 2023-08-01 14:15:56.619633484 +0200 +++ /var/tmp/diff_new_pack.IhSwsk/_new 2023-08-01 14:15:56.623633508 +0200 @@ -4,8 +4,8 @@ <param name="scm">git</param> <param name="exclude">.git</param> <param name="filename">salt-shaptools</param> - <param name="versionformat">0.3.11+git.%ct.%h</param> - <param name="revision">835d199a6117b0b5657f14ae8fc296af7709f382</param> + <param name="versionformat">0.3.18+git.%ct.%h</param> + <param name="revision">db379c1c46c7b2dd61680b1263dad220a819fbbc</param> </service> <service name="recompress" mode="disabled"> ++++++ salt-shaptools-0.3.11+git.1622732434.835d199.tar.gz -> salt-shaptools-0.3.18+git.1690200022.db379c1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/.codespell.ignore.files new/salt-shaptools-0.3.18+git.1690200022.db379c1/.codespell.ignore.files --- old/salt-shaptools-0.3.11+git.1622732434.835d199/.codespell.ignore.files 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/.codespell.ignore.files 2023-07-24 14:00:22.000000000 +0200 @@ -0,0 +1 @@ +venv,.git,saltvirtenv,htmlcov diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/.codespell.ignore.words new/salt-shaptools-0.3.18+git.1690200022.db379c1/.codespell.ignore.words --- old/salt-shaptools-0.3.11+git.1622732434.835d199/.codespell.ignore.words 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/.codespell.ignore.words 2023-07-24 14:00:22.000000000 +0200 @@ -0,0 +1,5 @@ +nd +uptodate +upto +enque +aas diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/.github/workflows/salt-shaptools-ci.yml new/salt-shaptools-0.3.18+git.1690200022.db379c1/.github/workflows/salt-shaptools-ci.yml --- old/salt-shaptools-0.3.11+git.1622732434.835d199/.github/workflows/salt-shaptools-ci.yml 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/.github/workflows/salt-shaptools-ci.yml 2023-07-24 14:00:22.000000000 +0200 @@ -1,56 +1,206 @@ +--- name: Package CI # - this workflow will -# - pytest with python version [2.7, 3.6, 3.7] -# - uploads coverage data to codeClimate and the results are linked as a badges in the README +# - test on +# - SLE 12 SP5 +# - python 2.7 +# - SLE 15 SP5 +# - python 3.6 # - deliver the package content to the configured repository # - submit the new package content to the upstream repository -on: [push, pull_request] +on: [push, pull_request] # yamllint disable-line rule:truthy env: PACKAGE_NAME: salt-shaptools jobs: + tab: + name: 'tabspace checking' + runs-on: ubuntu-22.04 - test: - runs-on: ubuntu-18.04 + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest + defaults: + run: + shell: bash + + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + + - name: tab + run: make test-tab + codespell: + name: 'spell checking' + runs-on: ubuntu-22.04 + + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest + defaults: + run: + shell: bash + + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + + - name: Install linting tools + run: | + sudo apt-get update + sudo apt-get install -y git python3 python3-pip + python3 -m pip install codespell + + - name: codespell + run: make test-codespell + + shellcheck: + name: 'script syntax check' + runs-on: ubuntu-22.04 + + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest + defaults: + run: + shell: bash + + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + + - name: Install linting tools + run: | + sudo apt-get update + sudo apt-get install -y git python3 python3-pip shellcheck + + - name: shellcheck + run: make test-shellcheck + + yamllint: + name: 'yaml linting' + runs-on: ubuntu-22.04 + + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest + defaults: + run: + shell: bash + + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + + - name: Install linting tools + run: | + sudo apt-get update + sudo apt-get install -y git python3 python3-pip + python3 -m pip install yamllint + + - name: yamllint + run: make test-yamllint + + jsonlint: + name: 'json linting' + runs-on: ubuntu-22.04 + + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest + defaults: + run: + shell: bash + + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + + - name: Install linting tools + run: | + sudo apt-get update + sudo apt-get install -y git python3 python3-pip + python3 -m pip install jsonlint + + - name: jsonlint + run: make test-jsonlint + + mlc: + name: 'markup link checker' + runs-on: ubuntu-22.04 + + # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest + defaults: + run: + shell: bash + + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + + - name: Install linting tools + run: | + mkdir bin + curl -L https://github.com/becheran/mlc/releases/download/v0.14.3/mlc-x86_64-linux -o bin/mlc + chmod +x bin/mlc + echo "$PWD/bin" >> $GITHUB_PATH + + - name: mlc + run: make test-mlc + + python: + runs-on: ubuntu-22.04 strategy: - matrix: - os: [ubuntu-18.04] - python-version: [2.7, 3.6, 3.7] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - pip install pyzmq PyYAML pycrypto msgpack-python jinja2 psutil futures tornado pytest-salt mock pytest-cov enum34 - git clone --depth=50 https://github.com/openSUSE/salt ../salt - rm ../salt/tests/conftest.py - git clone --depth=50 https://github.com/SUSE/shaptools.git ../shaptools - pip install -e ../salt - pip install ../shaptools - - name: execute test script - run: ./tests/run.sh - - name: change absolute path to relative path for successful upload to code climate - run: | - WORKSPACE=`dirname ${{ github.workspace }}`/salt/ - sed -i "s#$WORKSPACE##g" coverage.xml - - name: Publish code coverage - uses: paambaati/codeclimate-action@v2.7.5 - if: ${{ env.CC_TEST_REPORTER_ID != null && github.event_name != 'pull_request' }} - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - with: - coverageLocations: coverage.xml:coverage.py + # do not fail if other test fails + fail-fast: false + matrix: + container: + - registry.suse.com/suse/sles12sp5:latest # python 2.7 + - registry.suse.com/bci/bci-base:15.5 # python 3.6 + container: + image: ${{ matrix.container }} + steps: + - name: Auth to SCC and minimal dependencies + run: | + echo "username=${{ secrets.SCC_USERNAME }}" >/etc/zypp/credentials.d/SCCcredentials + echo "password=${{ secrets.SCC_PASSWORD }}" >>/etc/zypp/credentials.d/SCCcredentials + zypper ref -s + zypper -n in -y tar gzip git + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Install dependencies + run: | + zypper -n in -y make python + if test -f /usr/bin/python3; then + # minimal salt, python packages and compilers + zypper -n in -y salt python3-pip python3-devel gcc + # use current salt version shipped with SLE 15 + git clone --branch=openSUSE/release/3006.0 --depth=50 https://github.com/openSUSE/salt ../salt + # python 3.6 - official requirements from salt (works with python >3.6) + pip install -r ../salt/requirements/pytest.txt + pip install -r tests/requirements.3.6.yaml # pinned pytest-cov + # install shaptools + zypper addrepo https://download.opensuse.org/repositories/network:/ha-clustering:/sap-deployments:/devel/SLE_15_SP5/network:ha-clustering:sap-deployments:devel.repo + zypper --gpg-auto-import-keys ref + zypper -n in -y python3-shaptools + else + zypper -n in -y SUSEConnect + SUSEConnect -p sle-module-adv-systems-management/12/x86_64 + # minimal salt, python packages and compilers + zypper -n in -y salt python-pip python-devel gcc gcc-c++ + # python 2.7 - latest available versions for old python release + pip install --ignore-installed -r tests/requirements.2.7.yaml + # use current salt version shipped with SLE 12 + git clone --branch=openSUSE/release/3000.3 --depth=50 https://github.com/openSUSE/salt ../salt + # install shaptools + zypper addrepo https://download.opensuse.org/repositories/network:/ha-clustering:/sap-deployments:/devel/SLE_12_SP5/network:ha-clustering:sap-deployments:devel.repo + zypper --gpg-auto-import-keys ref + zypper -n in -y python-shaptools + fi + rm ../salt/tests/conftest.py + - name: execute test script + run: make test-python delivery: - needs: [test] - runs-on: ubuntu-18.04 + needs: [tab, codespell, shellcheck, yamllint, jsonlint, mlc, python] + runs-on: ubuntu-22.04 if: ${{ github.event_name != 'pull_request' }} container: image: shap/continuous_deliver @@ -59,26 +209,26 @@ OBS_PASS: ${{ secrets.OBS_PASS }} OBS_PROJECT: ${{ secrets.OBS_PROJECT }} steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: configure OSC - # OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home - # that is used to run osc commands - run: | - /scripts/init_osc_creds.sh - mkdir -p $HOME/.config/osc - cp /root/.config/osc/oscrc $HOME/.config/osc - - name: deliver package - run: | - sed -i 's~%%VERSION%%~${{ github.sha }}~' _service && \ - sed -i 's~%%REPOSITORY%%~${{ github.repository }}~' _service && \ - /scripts/upload.sh + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: configure OSC + # OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home + # that is used to run osc commands + run: | + /scripts/init_osc_creds.sh + mkdir -p $HOME/.config/osc + cp /root/.config/osc/oscrc $HOME/.config/osc + - name: deliver package + run: | + sed -i 's~%%VERSION%%~${{ github.sha }}~' _service && \ + sed -i 's~%%REPOSITORY%%~${{ github.repository }}~' _service && \ + /scripts/upload.sh submit: - needs: [test, delivery] - runs-on: ubuntu-18.04 + needs: [tab, codespell, shellcheck, yamllint, jsonlint, mlc, python, delivery] + runs-on: ubuntu-22.04 if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} container: image: shap/continuous_deliver @@ -88,18 +238,18 @@ OBS_PROJECT: ${{ secrets.OBS_PROJECT}} TARGET_PROJECT: ${{ secrets.TARGET_PROJECT}} steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: configure OSC - # OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home - # that is used to run osc commands - run: | - /scripts/init_osc_creds.sh - mkdir -p $HOME/.config/osc - cp /root/.config/osc/oscrc $HOME/.config/osc - - name: submit package - run: | - sed -i 's~%%VERSION%%~${{ github.sha }}~' _service && \ - sed -i 's~%%REPOSITORY%%~${{ github.repository }}~' _service && \ - /scripts/submit.sh + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: configure OSC + # OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home + # that is used to run osc commands + run: | + /scripts/init_osc_creds.sh + mkdir -p $HOME/.config/osc + cp /root/.config/osc/oscrc $HOME/.config/osc + - name: submit package + run: | + sed -i 's~%%VERSION%%~${{ github.sha }}~' _service && \ + sed -i 's~%%REPOSITORY%%~${{ github.repository }}~' _service && \ + /scripts/submit.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/.yamllint.yaml new/salt-shaptools-0.3.18+git.1690200022.db379c1/.yamllint.yaml --- old/salt-shaptools-0.3.11+git.1622732434.835d199/.yamllint.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/.yamllint.yaml 2023-07-24 14:00:22.000000000 +0200 @@ -0,0 +1,11 @@ +--- +extends: default + +ignore: | + venv + +rules: + # 80 chars should be enough, but don't fail if a line is longer + line-length: + max: 160 + level: warning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/Makefile new/salt-shaptools-0.3.18+git.1690200022.db379c1/Makefile --- old/salt-shaptools-0.3.11+git.1622732434.835d199/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/Makefile 2023-07-24 14:00:22.000000000 +0200 @@ -0,0 +1,82 @@ +# kudos: +# - https://medium.com/@exustash/three-good-practices-for-better-ci-cd-makefiles-5b93452e4cc3 +# - https://le-gall.bzh/post/makefile-based-ci-chain-for-go/ +# - https://makefiletutorial.com/ +# - https://www.cl.cam.ac.uk/teaching/0910/UnixTools/make.pdf +# +SHELL := /usr/bin/env bash # set default shell +.SHELLFLAGS = -c # Run commands in a -c flag + +.NOTPARALLEL: ; # wait for this target to finish +.EXPORT_ALL_VARIABLES: ; # send all vars to shell + +.PHONY: all # All targets are accessible for user +.DEFAULT: help # Running Make will run the help target + +BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +ifeq ($(BRANCH), HEAD) + BRANCH := ${CI_BUILD_REF_NAME} +endif + +# help: @ List available tasks of the project +help: + @grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +## test section +# All tests are called on "." if possible. +# If this is not possible a special loop is used +# to sum up all error codes. + +# test: @ Run all defined tests +test: test-tab test-codespell test-shellcheck test-yamllint test-jsonlint test-python + @echo "All tests Done!" + +# test-tab: @ Run linting to find files containing tabspaces +test-tab: + @for file in $(shell find . -regextype egrep -regex '.*\.(sls|yml|yaml)' ! -path "**/venv/*" ! -path "**/saltvirtenv/*"); do\ + grep -q -P '\t' $${file} ;\ + if [ "$$?" -eq 0 ]; then\ + err_add=1 ;\ + echo "Tab found in $${file}" ;\ + grep -H -n -P '\t' $${file} ;\ + else \ + err_add=0 ;\ + fi;\ + err=$$((err_add + err)) ;\ + done; exit $$err + +# test-codespell: @ Run spell check +test-codespell: + codespell -H -f -s -I .codespell.ignore.words -S $(shell cat .codespell.ignore.files) -C 4 -q 6 + +# test-shellcheck: @ Run linting on all shell scripts +test-shellcheck: + for file in $(shell find . -name '*.sh' ! -path "**/venv/*" ! -path "**/saltvirtenv/*"); do\ + echo $${file} ;\ + shellcheck -s bash -x $${file};\ + err=$$(($$? + err)) ;\ + done; exit $$err + +# test-yamllint: @ Run linting on all yaml files +test-yamllint: + # yamllint -c .yamllint.yaml -s . + yamllint -c .yamllint.yaml . + +# test-jsonlint: @ Run linting on all json files +test-jsonlint: + for file in $(shell find . -name '*.json' ! -path "**/venv/*" ! -path "**/saltvirtenv/*" ! -path "**/htmlcov/*"); do\ + echo $${file} ;\ + jq << $${file} >/dev/null;\ + err=$$(($$? + err)) ;\ + done; exit $$err + +# test-mlc: @ Run markup link checker +test-mlc: + mlc --throttle 1000 + +# test-python: @ Run Python Unit Tests +test-python: + ./tests/run.sh + +# all: @ Runs everything +all: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/README.md new/salt-shaptools-0.3.18+git.1690200022.db379c1/README.md --- old/salt-shaptools-0.3.11+git.1622732434.835d199/README.md 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/README.md 2023-07-24 14:00:22.000000000 +0200 @@ -1,6 +1,4 @@ [](https://github.com/SUSE/salt-shaptools/actions/workflows/salt-shaptools-ci.yml) -[](https://codeclimate.com/github/SUSE/salt-shaptools/test_coverage) -[](https://codeclimate.com/github/SUSE/salt-shaptools/maintainability) # SAP Applications and SUSE Linux Enterprise High Availability salt modules and States @@ -54,7 +52,7 @@ ## How to run the tests -Salt has a quite particular way to execute the tests. As a summary, tests are splitted +Salt has a quite particular way to execute the tests. As a summary, tests are split in _integration_ and _unit_ tests. The first group tests the module using actual salt master/minions, so the setup is more complicated. The _unit_ tests in the other hand only check the code functions. @@ -84,7 +82,14 @@ ```bash virtualenv saltvirtenv source saltvirtenv/bin/activate -pip install pyzmq PyYAML pycrypto msgpack-python jinja2 psutil futures tornado pytest-salt mock pytest-cov + +# python 3.6 - official requirements from salt (works with python >3.6) +pip install -r ../salt/requirements/pytest.txt +pip install -r tests/requirements.3.6.yaml # pinned pytest-cov +# or +# python 2.7 - latest available versions for old python release +pip install -r tests/requirements.2.7.yaml + pip install -e ../salt pip install -e ../shaptools rm ../salt/tests/conftest.py # remove this file from the saltstack repo @@ -115,9 +120,7 @@ ## Dependencies -List of dependencies are specified in the ["Requirements file"](requirements.txt). Items can be installed using pip: - - pip install -r requirements.txt +A list of dependencies is named above in the `pip install ...` commands. ## License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/_service new/salt-shaptools-0.3.18+git.1690200022.db379c1/_service --- old/salt-shaptools-0.3.11+git.1622732434.835d199/_service 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/_service 2023-07-24 14:00:22.000000000 +0200 @@ -4,7 +4,7 @@ <param name="scm">git</param> <param name="exclude">.git</param> <param name="filename">salt-shaptools</param> - <param name="versionformat">0.3.11+git.%ct.%h</param> + <param name="versionformat">0.3.18+git.%ct.%h</param> <param name="revision">%%VERSION%%</param> </service> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/crmshmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/crmshmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/crmshmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/crmshmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -64,8 +64,8 @@ 'The crmsh execution module failed to load: the ha-cluster-init' ' package is not available.') - __salt__['crm.version'] = version - __salt__['crm.use_crm'] = use_crm + __context__['crm.version'] = version + __context__['crm.use_crm'] = use_crm return __virtualname__ @@ -446,8 +446,8 @@ ocfs2_dev = [ocfs2_dev] # INFO: 2 different methods are created to make easy to read/understand - # and create the corresponing UT - if __salt__['crm.use_crm']: + # and create the corresponding UT + if __context__['crm.use_crm']: return _crm_init( name, watchdog, interface, unicast, admin_ip, sbd, sbd_dev, no_overwrite_sshkey, qnetd_hostname, quiet, ocfs2_dev, ocfs2_mount) @@ -535,8 +535,8 @@ salt '*' crm.cluster_join 192.168.1.41 ''' # INFO: 2 different methods are created to make easy to read/understand - # and create the corresponing UT - if __salt__['crm.use_crm']: + # and create the corresponding UT + if __context__['crm.use_crm']: return _crm_join(host, watchdog, interface, quiet) return _ha_cluster_join(host, watchdog, interface, quiet) @@ -699,7 +699,7 @@ * google-cloud-platform * None (as string)(otherwise) ''' - if int(__salt__['crm.version'][0]) <= 3: + if int(__context__['crm.version'][0]) <= 3: version = 'python' else: version = 'python3' @@ -707,4 +707,13 @@ cmd = '{version} -c "from crmsh import utils; print(utils.detect_cloud());"'.format( version=version) provider = __salt__['cmd.run'](cmd).strip() + + # workaround for https://github.com/SUSE/ha-sap-terraform-deployments/issues/832 + # until https://github.com/ClusterLabs/crmsh/pull/952 is available + if provider == 'None': + cmd = 'grep -i amazon /sys/class/dmi/id/sys_vendor' + return_code = __salt__['cmd.retcode'](cmd) + if return_code == 0: + provider = 'amazon-web-services' + return provider diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/drbdmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/drbdmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/drbdmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/drbdmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -14,13 +14,20 @@ .. code-block:: yaml ''' +# Import python libs from __future__ import absolute_import, print_function, unicode_literals - import logging -from salt.exceptions import CommandExecutionError -from salt.ext import six +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six +# Import salt libs +from salt.exceptions import CommandExecutionError import salt.utils.json import salt.utils.path @@ -266,7 +273,7 @@ Metadata still need to sync to disk after state changed. Only reply to sync target to change when I/O request finished, - which is unpredictable. Local refernece count is not 0 before endio. + which is unpredictable. Local reference count is not 0 before endio. ''' if not __salt__['drbd.json']: @@ -282,7 +289,7 @@ def _get_json_output_save(command): ''' - A warpper of get json command to acommandate json output issues + A wrapper of get json command to acommandate json output issues ''' error_str = '"estimated-seconds-to-finish": nan,' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/hanamod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/hanamod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/hanamod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/hanamod.py 2023-07-24 14:00:22.000000000 +0200 @@ -32,7 +32,15 @@ if sys.version_info.major == 2: # pragma: no cover import imp -from salt.ext.six.moves import reload_module +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext.six.moves import reload_module +except ImportError: + from six.moves import reload_module + +# Import salt libs from salt import exceptions from salt.utils import files as salt_files @@ -239,6 +247,36 @@ except hana.HanaError as err: raise exceptions.CommandExecutionError(err) +def add_hosts( + add_hosts, + hdblcm_folder, + root_user, + root_password, + hdb_pwd_file): + ''' + Add additional hosts to SAP HANA system + + add_hosts + hosts to add (same format as in hdblcm config) + hdblcm_folder + Path where hdblcm is installed + root_user + Root user name + root_password + Root user password + hdb_pwd_file + Path where XML password file exists + CLI Example: + + .. code-block:: bash + + salt '*' hana.add_hosts hana03:role=standby,hana05:role=worker /hana/shared/SID/hdblcm root root /root/hdb_passwords.xml + ''' + try: + hana.HanaInstance.add_hosts( + add_hosts, hdblcm_folder, root_user, root_password, hdb_pwd_file) + except hana.HanaError as err: + raise exceptions.CommandExecutionError(err) def uninstall( root_user, @@ -602,7 +640,7 @@ inst=None, password=None): ''' - Check the use key existance + Check the use key existence key User key name @@ -696,7 +734,7 @@ user_name User to connect to sap hana db user_password - Password to connecto to sap hana db + Password to connect to to sap hana db sid HANA system id (PRD for example) inst @@ -785,7 +823,7 @@ user_name User to connect to sap hana db user_password - Password to connecto to sap hana db + Password to connect to to sap hana db sid HANA system id (PRD for example) inst @@ -849,7 +887,7 @@ user_name User to connect to sap hana db user_password - Password to connecto to sap hana db + Password to connect to to sap hana db sid HANA system id (PRD for example) inst @@ -891,7 +929,7 @@ port HANA database port user - User to connect to the databse + User to connect to the database password Password to connect to the database timeout @@ -924,6 +962,51 @@ )) +def query( + host, + port, + user, + password, + query): + ''' + Execute a query on a HANA database + + host + Host where HANA is running + port + HANA database port + user + User to connect to the database + password + Password to connect to the database + query + Query to execute on database + + CLI Example: + + .. code-block:: bash + + salt '*' hana.query 192.168.10.15 30015 SYSTEM pass 'SELECT * FROM SCHEMAS' + ''' + + connector = hdb_connector.HdbConnector() + try: + connector.connect(host, port, user=user, password=password) + result = connector.query(query) + + except base_connector.QueryError as err: + if str(err) == "query failed: (0, 'No result set')": + pass # This is not error, but an empty query result. + else: + raise exceptions.CommandExecutionError( + 'HANA database query not successful on {}:{} with query "{}"'.format( + host, port, query + ) + ) + finally: + connector.disconnect() + + def reload_hdb_connector(): # pragma: no cover ''' As hdb_connector uses pyhdb or dbapi, if these packages are installed on the fly, @@ -966,7 +1049,7 @@ Args: software_folder (list): List of subfolder where the SAP folder is looked for` - folder_pattern (str): Pattern of the LABEL.ASC to look fo + folder_pattern (str): Pattern of the LABEL.ASC to look for recursion_level (int): Number of subfolder levels to check Examples: 1 means to check recursively in the subfolder present in software_folders folders diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/netweavermod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/netweavermod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/modules/netweavermod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/modules/netweavermod.py 2023-07-24 14:00:22.000000000 +0200 @@ -141,7 +141,7 @@ port: HANA database port schema_name: - Schema installed in the dabase + Schema installed in the database schema_password: Password of the user for the schema diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/crmshmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/crmshmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/crmshmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/crmshmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -32,11 +32,17 @@ # Import python libs from __future__ import absolute_import, unicode_literals, print_function +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six # Import salt libs from salt import exceptions from salt import utils as salt_utils -from salt.ext import six __virtualname__ = 'crm' @@ -251,7 +257,7 @@ is_xml=None, force=False): """ - Machine is congifured with the provided configuration file + Machine is configured with the provided configuration file name Used method. replace, update or push diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/drbdmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/drbdmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/drbdmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/drbdmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -36,12 +36,21 @@ .. code-block:: yaml ''' +# Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import time +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six + +# Import salt libs from salt.exceptions import CommandExecutionError -from salt.ext import six LOGGER = logging.getLogger(__name__) @@ -433,7 +442,7 @@ # May replace by "drbdsetup wait-sync-resource" in drbd9 with modification. -# Cause it only suspend when resoure is in syncing. +# Cause it only suspend when resource is in syncing. # Behavior the same when a resource not and finished sync. def wait_for_successful_synced(name, interval=30, timeout=600, **kwargs): ''' @@ -451,7 +460,7 @@ .. note:: - All other arguements are passed to the module drbd.check_sync_status. + All other arguments are passed to the module drbd.check_sync_status. ''' ret = { 'name': name, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/hanamod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/hanamod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/hanamod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/hanamod.py 2023-07-24 14:00:22.000000000 +0200 @@ -58,10 +58,16 @@ # Import python libs from __future__ import absolute_import, unicode_literals, print_function +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six # Import salt libs from salt import exceptions -from salt.ext import six __virtualname__ = 'hana' @@ -119,7 +125,7 @@ port: HANA database port user: - User to connect to the databse + User to connect to the database password: Password to connect to the database timeout: @@ -190,12 +196,12 @@ root_password Root user password config_file - If config_file paremeter is set, it will be downloaded from the master + If config_file parameter is set, it will be downloaded from the master to the minion and used in the installation. Values in this file might be changed setting then in the extra_parameters dictionary using the exact name as in the config file as a key hdb_pwd_file - If hdb_pwd_file paremeter is set, it will be downloaded from the master + If hdb_pwd_file parameter is set, it will be downloaded from the master to the minion and used in the installation. Values in this file might be changed setting then in the extra_parameters dictionary using the exact name as in the XML file as a key @@ -335,7 +341,7 @@ if not __salt__['hana.is_installed']( sid=sid, - ints=inst, + inst=inst, password=password): ret['result'] = True ret['comment'] = 'HANA already not installed' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/netweavermod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/netweavermod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/netweavermod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/netweavermod.py 2023-07-24 14:00:22.000000000 +0200 @@ -38,9 +38,16 @@ # Import python libs from __future__ import absolute_import, unicode_literals, print_function +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six + # Import salt libs from salt import exceptions -from salt.ext import six __virtualname__ = 'netweaver' @@ -227,7 +234,7 @@ port HANA database port schema_name: - Schema installed in the dabase + Schema installed in the database schema_password: Password of the user for the schema software_path: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/sapcarmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/sapcarmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/sapcarmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/sapcarmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -25,9 +25,16 @@ # Import python libs from __future__ import absolute_import, unicode_literals +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six + # Import salt libs from salt import exceptions -from salt.ext import six __virtualname__ = 'sapcar' @@ -83,4 +90,4 @@ except exceptions.CommandExecutionError as err: ret['comment'] = six.text_type(err) - return ret \ No newline at end of file + return ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/saptunemod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/saptunemod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt/states/saptunemod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt/states/saptunemod.py 2023-07-24 14:00:22.000000000 +0200 @@ -15,10 +15,16 @@ # Import python libs from __future__ import absolute_import, unicode_literals, print_function +# Import six - Python 2 and 3 compatibility library +# Salt no longer vendors six (>=salt-3006.0) +# https://github.com/saltstack/salt/issues/63874 +try: + from salt.ext import six +except ImportError: + import six # Import salt libs from salt import exceptions -from salt.ext import six __virtualname__ = 'saptune' @@ -62,7 +68,7 @@ # result is not null 0, so we have error if result: - ret['comment'] = 'Error appling saptune solution' + ret['comment'] = 'Error applying saptune solution' ret['result'] = False return ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt-shaptools.changes new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt-shaptools.changes --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt-shaptools.changes 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt-shaptools.changes 2023-07-24 14:00:22.000000000 +0200 @@ -1,4 +1,49 @@ ------------------------------------------------------------------- +Tue Jul 11 15:03:17 UTC 2023 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.18 + * Salt no longer vendors six (>=salt-3006.0) + https://github.com/saltstack/salt/issues/63874 + +------------------------------------------------------------------- +Fri Apr 28 08:55:32 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.17 + * add HANA add_hosts feature + +------------------------------------------------------------------- +Fri Apr 19 14:04:54 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.16 + * store crm state in __context__ instead of __salt__ + +------------------------------------------------------------------- +Fri Mar 18 15:02:13 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.15 + * workaround to detect aws cloud_provider + details https://github.com/SUSE/ha-sap-terraform-deployments/issues/832 + until https://github.com/ClusterLabs/crmsh/pull/952 is available + +------------------------------------------------------------------- +Wed Feb 2 16:36:27 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.14 + * do not raise exception on empty HANA query results + +------------------------------------------------------------------- +Thu Jan 20 13:37:10 UTC 2022 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.13 + * Add module query to HANA + +------------------------------------------------------------------- +Wed Jul 21 07:55:12 UTC 2021 - Eike Waldt <wa...@b1-systems.de> + +- Version 0.3.12 + * Fix typo to fix uninstalled state + +------------------------------------------------------------------- Thu Mar 11 17:05:02 UTC 2021 - Cédric Bosdonnat <cbosdon...@suse.com> - add cluster init support for OCFS2 device diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/salt-shaptools.spec new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt-shaptools.spec --- old/salt-shaptools-0.3.11+git.1622732434.835d199/salt-shaptools.spec 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/salt-shaptools.spec 2023-07-24 14:00:22.000000000 +0200 @@ -28,6 +28,11 @@ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +%if 0%{?suse_version} >= 1500 +Requires: python3-six +%else +Requires: python-six +%endif %description Salt modules and states for SAP Applications and SLE-HA components management diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/requirements.2.7.yaml new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/requirements.2.7.yaml --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/requirements.2.7.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/requirements.2.7.yaml 2023-07-24 14:00:22.000000000 +0200 @@ -0,0 +1,11 @@ +setuptools==44.1.1 +wheel==0.37.1 +pytest-cov==2.3.1 +jinja2==2.6 +pyyaml==3.12 +markupsafe==0.23 +requests==2.27 +certifi==2020.4.5.1 +pyzmq==18.0.1 +mock==3.0.0 +funcsigs==1.0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/requirements.3.6.yaml new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/requirements.3.6.yaml --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/requirements.3.6.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/requirements.3.6.yaml 2023-07-24 14:00:22.000000000 +0200 @@ -0,0 +1 @@ +pytest-cov==4.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/run.sh new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/run.sh --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/run.sh 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/run.sh 2023-07-24 14:00:22.000000000 +0200 @@ -1,5 +1,10 @@ +#!/usr/bin/env bash + +PYTHON=python3 +test -f /usr/bin/python2 && PYTHON=python2 + cp salt/modules/*.py ../salt/salt/modules/ cp salt/states/*.py ../salt/salt/states/ cp tests/unit/modules/*.py ../salt/tests/unit/modules/ cp tests/unit/states/*.py ../salt/tests/unit/states/ -py.test -vv ../salt/tests/unit/modules/test_hanamod.py ../salt/tests/unit/states/test_hanamod.py ../salt/tests/unit/modules/test_crmshmod.py ../salt/tests/unit/modules/test_saptunemod.py ../salt/tests/unit/modules/test_sapcarmod.py ../salt/tests/unit/states/test_crmshmod.py ../salt/tests/unit/modules/test_drbdmod.py ../salt/tests/unit/states/test_drbdmod.py ../salt/tests/unit/states/test_saptunemod.py ../salt/tests/unit/modules/test_netweavermod.py ../salt/tests/unit/states/test_netweavermod.py ../salt/tests/unit/states/test_sapcarmod.py --cov=salt.modules.hanamod --cov=salt.states.hanamod --cov=salt.modules.crmshmod --cov=salt.states.crmshmod --cov=salt.modules.drbdmod --cov=salt.modules.saptunemod --cov=salt.modules.sapcarmod --cov=salt.states.saptunemod --cov=salt.states.drbdmod --cov=salt.modules.netweavermod --cov=salt.states.netweavermod --cov=salt.states.sapcarmod --cov-config .coveragerc --cov-report term --cov-report xml --cov-report html +cd ../salt && $PYTHON -m pytest -vv ../salt/tests/unit/modules/test_hanamod.py ../salt/tests/unit/states/test_hanamod.py ../salt/tests/unit/modules/test_crmshmod.py ../salt/tests/unit/modules/test_saptunemod.py ../salt/tests/unit/modules/test_sapcarmod.py ../salt/tests/unit/states/test_crmshmod.py ../salt/tests/unit/modules/test_drbdmod.py ../salt/tests/unit/states/test_drbdmod.py ../salt/tests/unit/states/test_saptunemod.py ../salt/tests/unit/modules/test_netweavermod.py ../salt/tests/unit/states/test_netweavermod.py ../salt/tests/unit/states/test_sapcarmod.py --cov=salt.modules.hanamod --cov=salt.states.hanamod --cov=salt.modules.crmshmod --cov=salt.states.crmshmod --cov=salt.modules.drbdmod --cov=salt.modules.saptunemod --cov=salt.modules.sapcarmod --cov=salt.states.saptunemod --cov=salt.states.drbdmod --cov=salt.modules.netweavermod --cov=salt.states.netweavermod --cov=salt.states.sapcarmod --cov-config .coveragerc --cov-report term --cov-report xml --cov-report html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/modules/test_crmshmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/modules/test_crmshmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/modules/test_crmshmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/modules/test_crmshmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -448,7 +448,7 @@ Test cluster_init with crm option ''' - with patch.dict(crmshmod.__salt__, {'crm.use_crm': True}): + with patch.dict(crmshmod.__context__, {'crm.use_crm': True}): crm_init.return_value = 0 value = crmshmod.cluster_init('hacluster', 'dog', 'eth1', sbd=True, sbd_dev='dev1') assert value == 0 @@ -456,7 +456,7 @@ 'hacluster', 'dog', 'eth1', None, None, True, ['dev1'], False, None, None, None, None) crm_init.reset_mock() - with patch.dict(crmshmod.__salt__, {'crm.use_crm': True}): + with patch.dict(crmshmod.__context__, {'crm.use_crm': True}): crm_init.return_value = 0 value = crmshmod.cluster_init('hacluster', 'dog', 'eth1', sbd=False, sbd_dev=['disk1', 'disk2'], ocfs2_dev='disk3', ocfs2_mount='mount') assert value == 0 @@ -470,7 +470,7 @@ Test cluster_init with ha_cluster_init option ''' - with patch.dict(crmshmod.__salt__, {'crm.use_crm': False}): + with patch.dict(crmshmod.__context__, {'crm.use_crm': False}): ha_cluster_init.return_value = 0 value = crmshmod.cluster_init( 'hacluster', 'dog', 'eth1', sbd_dev='dev1', no_overwrite_sshkey=True) @@ -567,7 +567,7 @@ ''' Test cluster_join with crm option ''' - with patch.dict(crmshmod.__salt__, {'crm.use_crm': True}): + with patch.dict(crmshmod.__context__, {'crm.use_crm': True}): crm_join.return_value = 0 value = crmshmod.cluster_join('host', 'dog', 'eth1') assert value == 0 @@ -579,7 +579,7 @@ ''' Test cluster_join with ha_cluster_join option ''' - with patch.dict(crmshmod.__salt__, {'crm.use_crm': False}): + with patch.dict(crmshmod.__context__, {'crm.use_crm': False}): ha_cluster_join.return_value = 0 value = crmshmod.cluster_join('host', 'dog', 'eth1') assert value == 0 @@ -759,11 +759,10 @@ mock_versin = '3.0.0' mock_cmd_run = MagicMock(return_value='my-cloud ') - with patch.dict(crmshmod.__salt__, { - 'crm.version': mock_versin, - 'cmd.run': mock_cmd_run}): - result = crmshmod.detect_cloud() - assert result == 'my-cloud' + with patch.dict(crmshmod.__context__, {'crm.version': mock_versin}): + with patch.dict(crmshmod.__salt__, {'cmd.run': mock_cmd_run}): + result = crmshmod.detect_cloud() + assert result == 'my-cloud' mock_cmd_run.assert_called_once_with( 'python -c "from crmsh import utils; print(utils.detect_cloud());"') @@ -775,11 +774,10 @@ mock_versin = '4.0.0' mock_cmd_run = MagicMock(return_value='my-cloud ') - with patch.dict(crmshmod.__salt__, { - 'crm.version': mock_versin, - 'cmd.run': mock_cmd_run}): - result = crmshmod.detect_cloud() - assert result == 'my-cloud' + with patch.dict(crmshmod.__context__, {'crm.version': mock_versin}): + with patch.dict(crmshmod.__salt__, {'cmd.run': mock_cmd_run}): + result = crmshmod.detect_cloud() + assert result == 'my-cloud' mock_cmd_run.assert_called_once_with( 'python3 -c "from crmsh import utils; print(utils.detect_cloud());"') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/modules/test_drbdmod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/modules/test_drbdmod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/modules/test_drbdmod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/modules/test_drbdmod.py 2023-07-24 14:00:22.000000000 +0200 @@ -687,7 +687,7 @@ assert drbd.check_sync_status('shanghai') mock_cmd.assert_called_with('drbdsetup status --json shanghai') - # Test 2: Test _is_no_backing_dev_request() have unfinished requrests + # Test 2: Test _is_no_backing_dev_request() have unfinished requests fake = {} fake['stdout'] = ''' [ @@ -751,7 +751,7 @@ assert not drbd.check_sync_status('shanghai') mock_cmd.assert_called_with('drbdsetup status --json shanghai') - # Test 3: Test _is_no_backing_dev_request() all requrests finished + # Test 3: Test _is_no_backing_dev_request() all requests finished fake = {} fake['stdout'] = ''' [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/modules/test_hanamod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/modules/test_hanamod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/modules/test_hanamod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/modules/test_hanamod.py 2023-07-24 14:00:22.000000000 +0200 @@ -202,6 +202,32 @@ 'software_path', 'hana.conf', 'root', 'root', 'hana.conf.xml') assert 'hana error' in str(err.value) + @patch('salt.modules.hanamod.hana.HanaInstance') + def test_add_hosts_return(self, mock_hana): + ''' + Test add_hosts method - return + ''' + mock_hana.add_hosts.return_value = 'hana.conf' + hanamod.add_hosts( + 'add_hosts', 'hdblcm_folder', 'root', 'root', 'hdb_pwd_file') + mock_hana.add_hosts.assert_called_once_with( + 'add_hosts', 'hdblcm_folder', 'root', 'root', 'hdb_pwd_file') + + @patch('salt.modules.hanamod.hana.HanaInstance') + def test_add_hosts_raise(self, mock_hana): + ''' + Test add_hosts method - raise + ''' + mock_hana.add_hosts.side_effect = hanamod.hana.HanaError( + 'hana error' + ) + with pytest.raises(exceptions.CommandExecutionError) as err: + hanamod.add_hosts( + 'add_hosts', 'hdblcm_folder', 'root', 'root', 'hdb_pwd_file') + mock_hana.add_hosts.assert_called_once_with( + 'add_hosts', 'hdblcm_folder', 'root', 'root', 'hdb_pwd_file') + assert 'hana error' in str(err.value) + def test_uninstall_return(self): ''' Test uninstall method - return @@ -813,6 +839,50 @@ ]) assert 'HANA database not available after 2 seconds in 192.168.10.15:30015' in str(err.value) + @mock.patch('salt.modules.hanamod.hdb_connector.HdbConnector') + def test_query(self, mock_hdb_connector): + mock_hdb_instance = mock.Mock() + mock_hdb_connector.return_value = mock_hdb_instance + + hanamod.query( + '192.168.10.15', 30015, 'SYSTEM', 'pass', 'query') + + mock_hdb_instance.connect.assert_called_once_with( + '192.168.10.15', 30015, user='SYSTEM', password='pass') + mock_hdb_instance.query.assert_called_once_with('query') + mock_hdb_instance.disconnect.assert_called_once_with() + + @mock.patch('salt.modules.hanamod.hdb_connector.HdbConnector') + def test_query_error(self, mock_hdb_connector): + mock_hdb_instance = mock.Mock() + mock_hdb_connector.return_value = mock_hdb_instance + + mock_hdb_instance.query.side_effect = hanamod.base_connector.QueryError('error') + with pytest.raises(exceptions.CommandExecutionError) as err: + hanamod.query( + '192.168.10.15', 30015, 'SYSTEM', 'pass', 'query') + + mock_hdb_instance.connect.assert_called_once_with( + '192.168.10.15', 30015, user='SYSTEM', password='pass') + mock_hdb_instance.query.assert_called_once_with('query') + assert('HANA database query not successful on {}:{} with query "{}"'.format( + '192.168.10.15', '30015', 'query')) in str(err.value) + mock_hdb_instance.disconnect.assert_called_once_with() + + @mock.patch('salt.modules.hanamod.hdb_connector.HdbConnector') + def test_query_result_empty(self, mock_hdb_connector): + mock_hdb_instance = mock.Mock() + mock_hdb_connector.return_value = mock_hdb_instance + + mock_hdb_instance.query.side_effect = hanamod.base_connector.QueryError("query failed: (0, 'No result set')") + hanamod.query( + '192.168.10.15', 30015, 'SYSTEM', 'pass', 'query') + + mock_hdb_instance.connect.assert_called_once_with( + '192.168.10.15', 30015, user='SYSTEM', password='pass') + mock_hdb_instance.query.assert_called_once_with('query') + mock_hdb_instance.disconnect.assert_called_once_with() + @mock.patch('salt.modules.hanamod.hdb_connector') @mock.patch('salt.modules.hanamod.reload_module') def test_reload_hdb_connector_py3(self, mock_reload, mock_hdb_connector): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/states/test_saptunemod.py new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/states/test_saptunemod.py --- old/salt-shaptools-0.3.11+git.1622732434.835d199/tests/unit/states/test_saptunemod.py 2021-06-03 17:00:34.000000000 +0200 +++ new/salt-shaptools-0.3.18+git.1690200022.db379c1/tests/unit/states/test_saptunemod.py 2023-07-24 14:00:22.000000000 +0200 @@ -83,7 +83,7 @@ 'changes': {}, 'result': False, 'name': solution_name, - 'comment': "Error appling saptune solution" + 'comment': "Error applying saptune solution" } with patch.dict(saptune.__salt__, {