Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-shaptools for openSUSE:Factory checked in at 2023-01-23 18:32:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-shaptools (Old) and /work/SRC/openSUSE:Factory/.python-shaptools.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-shaptools" Mon Jan 23 18:32:25 2023 rev:20 rq:1060349 version:0.3.13+git.1673855974.f208fad Changes: -------- --- /work/SRC/openSUSE:Factory/python-shaptools/python-shaptools.changes 2021-04-21 21:01:12.594372442 +0200 +++ /work/SRC/openSUSE:Factory/.python-shaptools.new.32243/python-shaptools.changes 2023-01-23 18:32:37.228332928 +0100 @@ -1,0 +2,16 @@ +Fri Jan 13 02:13:36 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Correct macro usage, %ifpython2 is only suitable for Requires. + +------------------------------------------------------------------- +Thu Jan 5 23:44:22 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Only BuildRequire python-mock under Python 2. + +------------------------------------------------------------------- +Fri Mar 25 15:45:21 UTC 2021 - Eike Walldt <wa...@b1-systems.de> + +- Create version 0.3.13 +- add HANA add_hosts feature + +------------------------------------------------------------------- @@ -159,2 +175,2 @@ -- Forces Intance nr always with 2 positions filled with 0 -- Forces right formating on HANA OS admin user. +- Forces Instance nr always with 2 positions filled with 0 +- Forces right formatting on HANA OS admin user. Old: ---- python-shaptools-0.3.12+git.1619007514.1951d23.tar.gz New: ---- python-shaptools-0.3.13+git.1673855974.f208fad.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-shaptools.spec ++++++ --- /var/tmp/diff_new_pack.o7QtDC/_old 2023-01-23 18:32:37.940337855 +0100 +++ /var/tmp/diff_new_pack.o7QtDC/_new 2023-01-23 18:32:37.948337910 +0100 @@ -20,9 +20,15 @@ %bcond_without test %endif +%if 0%{?sle_version} <= 150300 && !0%{?is_opensuse} +%bcond_without python2 +%else +%bcond_with python2 +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-shaptools -Version: 0.3.12+git.1619007514.1951d23 +Version: 0.3.13+git.1673855974.f208fad Release: 0 Summary: Python tools to interact with SAP HANA utilities License: Apache-2.0 @@ -30,9 +36,11 @@ Url: https://github.com/SUSE/shaptools Source: %{name}-%{version}.tar.gz %if %{with test} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} %endif +%if %{with python2} +BuildRequires: python-mock +%endif BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros ++++++ _service ++++++ --- /var/tmp/diff_new_pack.o7QtDC/_old 2023-01-23 18:32:37.976338104 +0100 +++ /var/tmp/diff_new_pack.o7QtDC/_new 2023-01-23 18:32:37.976338104 +0100 @@ -4,8 +4,8 @@ <param name="scm">git</param> <param name="exclude">.git</param> <param name="filename">python-shaptools</param> - <param name="versionformat">@PARENT_TAG@+git.%ct.%h</param> - <param name="revision">1951d234b51114379befab11c99c92dfa179a83f</param> + <param name="versionformat">0.3.13+git.%ct.%h</param> + <param name="revision">f208fad36c1d85f64c83e4f3fd4f0f5ca2ba30cf</param> </service> <service name="recompress" mode="disabled"> ++++++ python-shaptools-0.3.12+git.1619007514.1951d23.tar.gz -> python-shaptools-0.3.13+git.1673855974.f208fad.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/.codeclimate.yml new/python-shaptools-0.3.13+git.1673855974.f208fad/.codeclimate.yml --- old/python-shaptools-0.3.12+git.1619007514.1951d23/.codeclimate.yml 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/.codeclimate.yml 2023-01-16 08:59:34.000000000 +0100 @@ -1,3 +1,4 @@ +--- version: "2" checks: method-complexity: @@ -5,4 +6,4 @@ threshold: 8 file-lines: config: - threshold: 1024 \ No newline at end of file + threshold: 1024 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/.codespell.ignore.files new/python-shaptools-0.3.13+git.1673855974.f208fad/.codespell.ignore.files --- old/python-shaptools-0.3.12+git.1619007514.1951d23/.codespell.ignore.files 1970-01-01 01:00:00.000000000 +0100 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/.codespell.ignore.files 2023-01-16 08:59:34.000000000 +0100 @@ -0,0 +1 @@ +venv,.git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/.codespell.ignore.words new/python-shaptools-0.3.13+git.1673855974.f208fad/.codespell.ignore.words --- old/python-shaptools-0.3.12+git.1619007514.1951d23/.codespell.ignore.words 1970-01-01 01:00:00.000000000 +0100 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/.codespell.ignore.words 2023-01-16 08:59:34.000000000 +0100 @@ -0,0 +1 @@ +enque diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/.github/workflows/shaptools-ci.yml new/python-shaptools-0.3.13+git.1673855974.f208fad/.github/workflows/shaptools-ci.yml --- old/python-shaptools-0.3.12+git.1619007514.1951d23/.github/workflows/shaptools-ci.yml 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/.github/workflows/shaptools-ci.yml 2023-01-16 08:59:34.000000000 +0100 @@ -1,46 +1,173 @@ +--- name: Package CI # - this workflow will # - test python version matrix [2.7, 3.6, 3.7, 3.8, 3.9] for coverage # - uploads coverage data to codeClimate and the results are linked as a badges in the README # - 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: python-shaptools TAR_NAME: shaptools jobs: + tab: + name: 'tabspace checking' + runs-on: ubuntu-20.04 - test-python: - 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-20.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 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-20.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 install -y git python3 python3-pip shellcheck + + - name: shellcheck + run: make test-shellcheck + + yamllint: + name: 'yaml linting' + runs-on: ubuntu-20.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 install -y git python3 python3-pip + python3 -m pip install codespell + + - name: yamllint + run: make test-yamllint + + jsonlint: + name: 'json linting' + runs-on: ubuntu-20.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 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-20.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 -p 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-20.04 strategy: matrix: - os: [ubuntu-18.04] + os: [ubuntu-20.04] python-version: [2.7, 3.6, 3.7, 3.8, 3.9] 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: Test python version [2.7, 3.6, 3.7, 3.8, 3.9] and install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest pytest-cov mock - - name: Test with pytest - run: py.test -vv --cov=shaptools --cov-config .coveragerc --cov-report term --cov-report xml tests - - 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 + - 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: Test python version [2.7, 3.6, 3.7, 3.8, 3.9] and install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov mock + - name: Test with pytest + run: make test-python + - 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 delivery: - needs: [test-python] - runs-on: ubuntu-18.04 + needs: [tab, codespell, shellcheck, yamllint, jsonlint, mlc, python] + runs-on: ubuntu-20.04 if: ${{ github.event_name != 'pull_request' }} container: image: shap/continuous_deliver @@ -49,25 +176,25 @@ 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-python, delivery] - runs-on: ubuntu-18.04 + needs: [tab, codespell, shellcheck, yamllint, jsonlint, mlc, python, delivery] + runs-on: ubuntu-20.04 if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} container: image: shap/continuous_deliver @@ -77,18 +204,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/python-shaptools-0.3.12+git.1619007514.1951d23/.pylintrc new/python-shaptools-0.3.13+git.1673855974.f208fad/.pylintrc --- old/python-shaptools-0.3.12+git.1619007514.1951d23/.pylintrc 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/.pylintrc 2023-01-16 08:59:34.000000000 +0100 @@ -60,7 +60,7 @@ # can either give multiple identifiers separated by comma (,) or put this # option multiple times (only on the command line, not in the configuration # file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if +# disable everything first and then re-enable specific checks. For example, if # you want to run only the similarities checker, you can use "--disable=all # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/.yamllint.yaml new/python-shaptools-0.3.13+git.1673855974.f208fad/.yamllint.yaml --- old/python-shaptools-0.3.12+git.1619007514.1951d23/.yamllint.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/.yamllint.yaml 2023-01-16 08:59:34.000000000 +0100 @@ -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/python-shaptools-0.3.12+git.1619007514.1951d23/Makefile new/python-shaptools-0.3.13+git.1673855974.f208fad/Makefile --- old/python-shaptools-0.3.12+git.1619007514.1951d23/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/Makefile 2023-01-16 08:59:34.000000000 +0100 @@ -0,0 +1,90 @@ +# 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/*"); 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/*"); 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/*"); do\ + echo $${file} ;\ + jq << $${file} >/dev/null;\ + err=$$(($$? + err)) ;\ + done; exit $$err + +# test-mlc: @ Run markup link checker +test-mlc: + mkdir -p aws/.terraform # make sure ingore-path exists + mlc --throttle 1000 \ + --ignore-path \ + **/.terraform \ + --ignore-links \ + ./terraform.tvars.example \ + ../pillar/*/* \ + https://github.com/SUSE/ha-sap-terraform-deployments/actions \ + https://github.com/SUSE/ha-sap-terraform-deployments/workflows/CI%20tests/badge.svg + +# test-python: @ Run Python Unit Tests +test-python: + py.test -vv --cov=shaptools --cov-config .coveragerc --cov-report term --cov-report xml tests + +# all: @ Runs everything +all: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/_service new/python-shaptools-0.3.13+git.1673855974.f208fad/_service --- old/python-shaptools-0.3.12+git.1619007514.1951d23/_service 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/_service 2023-01-16 08:59:34.000000000 +0100 @@ -4,7 +4,7 @@ <param name="scm">git</param> <param name="exclude">.git</param> <param name="filename">python-shaptools</param> - <param name="versionformat">@PARENT_TAG@+git.%ct.%h</param> + <param name="versionformat">0.3.13+git.%ct.%h</param> <param name="revision">%%VERSION%%</param> </service> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/python-shaptools.changes new/python-shaptools-0.3.13+git.1673855974.f208fad/python-shaptools.changes --- old/python-shaptools-0.3.12+git.1619007514.1951d23/python-shaptools.changes 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/python-shaptools.changes 2023-01-16 08:59:34.000000000 +0100 @@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Fri Jan 13 02:13:36 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Correct macro usage, %ifpython2 is only suitable for Requires. + +------------------------------------------------------------------- +Thu Jan 5 23:44:22 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Only BuildRequire python-mock under Python 2. + +------------------------------------------------------------------- +Fri Mar 25 15:45:21 UTC 2021 - Eike Walldt <wa...@b1-systems.de> + +- Create version 0.3.13 +- add HANA add_hosts feature + +------------------------------------------------------------------- Fri Mar 12 14:59:00 UTC 2021 - Xabier Arbulu <xarb...@suse.com> - Create version 0.3.12 @@ -156,8 +172,8 @@ - Fix UT to check the inst formatting correctly - Move the comment to the right place - Enforce the HANA instance nr format. -- Forces Intance nr always with 2 positions filled with 0 -- Forces right formating on HANA OS admin user. +- Forces Instance nr always with 2 positions filled with 0 +- Forces right formatting on HANA OS admin user. ------------------------------------------------------------------- Thu Dec 20 08:33:10 UTC 2018 - xarb...@suse.com diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/python-shaptools.spec new/python-shaptools-0.3.13+git.1673855974.f208fad/python-shaptools.spec --- old/python-shaptools-0.3.12+git.1619007514.1951d23/python-shaptools.spec 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/python-shaptools.spec 2023-01-16 08:59:34.000000000 +0100 @@ -20,6 +20,12 @@ %bcond_without test %endif +%if 0%{?sle_version} <= 150300 && !0%{?is_opensuse} +%bcond_without python2 +%else +%bcond_with python2 +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-shaptools Version: 0 @@ -30,9 +36,11 @@ Url: https://github.com/SUSE/shaptools Source: %{name}-%{version}.tar.gz %if %{with test} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} %endif +%if %{with python2} +BuildRequires: python-mock +%endif BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/__init__.py new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/__init__.py --- old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/__init__.py 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/__init__.py 2023-01-16 08:59:34.000000000 +0100 @@ -6,4 +6,4 @@ :since: 2018-11-15 """ -__version__ = "0.3.12" +__version__ = "0.3.13" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/hana.py new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/hana.py --- old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/hana.py 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/hana.py 2023-01-16 08:59:34.000000000 +0100 @@ -320,6 +320,32 @@ if result.returncode: raise HanaError('SAP HANA uninstallation failed') + @classmethod + def add_hosts( + cls, add_hosts, hdblcm_folder, root_user, root_password, hdb_pwd_file, remote_host=None): + """ + Add additional hosts to SAP HANA system + + Args: + add_hosts (str): hosts to add ($host1:role=$role,$host2:role=$role,...) + hdblcm_folder (str): Path where hdblcm is installed + root_user (str): Root user name + root_password (str): Root user password + hdb_pwd_file (str): Path to the XML password file + remote_host (str, opt): Remote host where the command will be executed + """ + + if not os.path.isfile(hdb_pwd_file): + raise FileDoesNotExistError( + 'The XML password file \'{}\' does not exist'.format(hdb_pwd_file)) + executable = cls.find_hana_hdblcm(hdblcm_folder) + cmd = 'cat {hdb_pwd_file} | {executable} -b '\ + '--read_password_from_stdin=xml --action=add_hosts --addhosts={add_hosts}'.format( + hdb_pwd_file=hdb_pwd_file, executable=executable, add_hosts=add_hosts) + result = shell.execute_cmd(cmd, root_user, root_password, remote_host) + if result.returncode: + raise HanaError('SAP HANA add_hosts failed') + def is_running(self): """ Check if SAP HANA daemon is running @@ -534,7 +560,7 @@ def check_user_key(self, key_name): """ - Check the use key existance + Check the use key existence Args: key (str): Key name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/netweaver.py new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/netweaver.py --- old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/netweaver.py 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/netweaver.py 2023-01-16 08:59:34.000000000 +0100 @@ -41,7 +41,7 @@ remote_host (str, opt): Remote host where the command will be executed """ - # SID is usualy written uppercased, but the OS user is always created lower case. + # SID is usually written uppercased, but the OS user is always created lower case. NETWEAVER_USER = '{sid}adm'.lower() UNINSTALL_PRODUCT = 'NW_Uninstall:GENERIC.IND.PD' GETPROCESSLIST_SUCCESS_CODES = [0, 3, 4] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/shapcli.py new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/shapcli.py --- old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/shapcli.py 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/shapcli.py 2023-01-16 08:59:34.000000000 +0100 @@ -98,7 +98,7 @@ def parse_hana_arguments(hana_subparser): """ - Parse hana subcommand arguements + Parse hana subcommand arguments """ subcommands = hana_subparser.add_subparsers( title='hana', dest='hana', help='Commands to interact with SAP HANA databse') @@ -177,7 +177,7 @@ def parse_sr_arguments(sr_subparser): """ - Parse hana sr subcommand arguements + Parse hana sr subcommand arguments """ subcommands = sr_subparser.add_subparsers( title='sr', dest='sr', help='Commands to interact with SAP HANA system replication') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/shell.py new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/shell.py --- old/python-shaptools-0.3.12+git.1619007514.1951d23/shaptools/shell.py 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/shaptools/shell.py 2023-01-16 08:59:34.000000000 +0100 @@ -39,7 +39,7 @@ def __init__(self, cmd, returncode, output, err): self.cmd = cmd self.returncode = returncode - self.output = output.decode() # Make it compatiable with python2 and 3 + self.output = output.decode() # Make it compatible with python2 and 3 self.err = err.decode() @@ -154,7 +154,7 @@ shlex.split(cmd), stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) - # Make it compatiable with python2 and 3 + # Make it compatible with python2 and 3 if password: password = password.encode() out, err = proc.communicate(input=password) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/hana_test.py new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/hana_test.py --- old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/hana_test.py 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/hana_test.py 2023-01-16 08:59:34.000000000 +0100 @@ -448,6 +448,59 @@ self.assertTrue( 'SAP HANA uninstallation failed' in str(err.exception)) + @mock.patch('shaptools.hana.HanaInstance.find_hana_hdblcm') + @mock.patch('shaptools.shell.execute_cmd') + @mock.patch('os.path.isfile') + def test_add_hosts(self, mock_conf_file, mock_execute, mock_find_hana): + proc_mock = mock.Mock() + proc_mock.returncode = 0 + mock_conf_file.side_effect = [True, True] + mock_execute.return_value = proc_mock + mock_find_hana.return_value = 'my_path/hdblcm' + + hana.HanaInstance.add_hosts( + 'add_hosts', 'hdblcm_folder', 'root', 'pass', 'hdb_pwd_file') + + mock_execute.assert_called_once_with( + 'cat {hdb_pwd_file} | {executable} -b ' + '--read_password_from_stdin=xml --action=add_hosts --addhosts={add_hosts}'.format( + hdb_pwd_file='hdb_pwd_file', executable='my_path/hdblcm', add_hosts='add_hosts'), 'root', 'pass', None) + mock_find_hana.assert_called_once_with('hdblcm_folder') + + @mock.patch('shaptools.hana.HanaInstance.find_hana_hdblcm') + @mock.patch('shaptools.shell.execute_cmd') + @mock.patch('os.path.isfile') + def test_add_hosts_error(self, mock_conf_file, mock_execute, mock_find_hana): + proc_mock = mock.Mock() + proc_mock.returncode = 1 + mock_conf_file.side_effect = [True, True] + mock_execute.return_value = proc_mock + mock_find_hana.return_value = 'my_path/hdblcm' + + with self.assertRaises(hana.HanaError) as err: + hana.HanaInstance.add_hosts( + 'add_hosts', 'hdblcm_folder', 'root', 'pass', 'hdb_pwd_file') + + mock_execute.assert_called_once_with( + 'cat {hdb_pwd_file} | {executable} -b ' + '--read_password_from_stdin=xml --action=add_hosts --addhosts={add_hosts}'.format( + hdb_pwd_file='hdb_pwd_file', executable='my_path/hdblcm', add_hosts='add_hosts'), 'root', 'pass', None) + mock_find_hana.assert_called_once_with('hdblcm_folder') + + self.assertTrue( + 'SAP HANA add_hosts failed' in str(err.exception)) + + @mock.patch('os.path.isfile') + def test_add_hosts_xml_FileDoesNotExistError(self, mock_passwords_xml): + mock_passwords_xml.side_effect = [False] + + with self.assertRaises(hana.FileDoesNotExistError) as err: + hana.HanaInstance.add_hosts( + 'add_hosts', 'hdblcm_folder', 'root', 'pass', 'hdb_password.xml') + + self.assertTrue( + 'The XML password file \'{}\' does not exist'.format('hdb_password.xml') in str(err.exception)) + @mock.patch('shaptools.shell.execute_cmd') def test_is_running(self, mock_execute): mock_command = mock.Mock() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/support/modified.inifile.params new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/support/modified.inifile.params --- old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/support/modified.inifile.params 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/support/modified.inifile.params 2023-01-16 08:59:34.000000000 +0100 @@ -33,7 +33,7 @@ -# Human readable form of the default login language to be preselected in SAPGUI. This Parameter is potentialy prompted in addition in the screen that also asks for the <SAPSID>. It is only prompted in systems that have an ABAP stack. It is prompted for installation but not for system copy. It is asked in those installations, that perform the ABAP load. That could be the database load installation in case of a distributed system szenario, or in case of a standard system installation with all instances on one host. This Parameter is saved in the 'DEFAULT' profile. It is has no influence on language settings in a Java stack. Valid names are stored in a table of subcomponent 'NW_languagesInLoadChecks'. The available languages must be declaired in the 'LANGUAGES_IN_LOAD' parameter of the 'product.xml' file . In this file, the one-character representation of the languages is used. Check the same table in subcomponent 'NW_languagesInLoadChecks'. +# Human readable form of the default login language to be preselected in SAPGUI. This Parameter is potentially prompted in addition in the screen that also asks for the <SAPSID>. It is only prompted in systems that have an ABAP stack. It is prompted for installation but not for system copy. It is asked in those installations, that perform the ABAP load. That could be the database load installation in case of a distributed system scenario, or in case of a standard system installation with all instances on one host. This Parameter is saved in the 'DEFAULT' profile. It is has no influence on language settings in a Java stack. Valid names are stored in a table of subcomponent 'NW_languagesInLoadChecks'. The available languages must be declaired in the 'LANGUAGES_IN_LOAD' parameter of the 'product.xml' file . In this file, the one-character representation of the languages is used. Check the same table in subcomponent 'NW_languagesInLoadChecks'. # NW_GetSidNoProfiles.SAP_GUI_DEFAULT_LANGUAGE = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/support/new.inifile.params new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/support/new.inifile.params --- old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/support/new.inifile.params 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/support/new.inifile.params 2023-01-16 08:59:34.000000000 +0100 @@ -33,7 +33,7 @@ -# Human readable form of the default login language to be preselected in SAPGUI. This Parameter is potentialy prompted in addition in the screen that also asks for the <SAPSID>. It is only prompted in systems that have an ABAP stack. It is prompted for installation but not for system copy. It is asked in those installations, that perform the ABAP load. That could be the database load installation in case of a distributed system szenario, or in case of a standard system installation with all instances on one host. This Parameter is saved in the 'DEFAULT' profile. It is has no influence on language settings in a Java stack. Valid names are stored in a table of subcomponent 'NW_languagesInLoadChecks'. The available languages must be declaired in the 'LANGUAGES_IN_LOAD' parameter of the 'product.xml' file . In this file, the one-character representation of the languages is used. Check the same table in subcomponent 'NW_languagesInLoadChecks'. +# Human readable form of the default login language to be preselected in SAPGUI. This Parameter is potentially prompted in addition in the screen that also asks for the <SAPSID>. It is only prompted in systems that have an ABAP stack. It is prompted for installation but not for system copy. It is asked in those installations, that perform the ABAP load. That could be the database load installation in case of a distributed system scenario, or in case of a standard system installation with all instances on one host. This Parameter is saved in the 'DEFAULT' profile. It is has no influence on language settings in a Java stack. Valid names are stored in a table of subcomponent 'NW_languagesInLoadChecks'. The available languages must be declaired in the 'LANGUAGES_IN_LOAD' parameter of the 'product.xml' file . In this file, the one-character representation of the languages is used. Check the same table in subcomponent 'NW_languagesInLoadChecks'. # NW_GetSidNoProfiles.SAP_GUI_DEFAULT_LANGUAGE = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/support/original.inifile.params new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/support/original.inifile.params --- old/python-shaptools-0.3.12+git.1619007514.1951d23/tests/support/original.inifile.params 2021-04-21 14:18:34.000000000 +0200 +++ new/python-shaptools-0.3.13+git.1673855974.f208fad/tests/support/original.inifile.params 2023-01-16 08:59:34.000000000 +0100 @@ -33,7 +33,7 @@ -# Human readable form of the default login language to be preselected in SAPGUI. This Parameter is potentialy prompted in addition in the screen that also asks for the <SAPSID>. It is only prompted in systems that have an ABAP stack. It is prompted for installation but not for system copy. It is asked in those installations, that perform the ABAP load. That could be the database load installation in case of a distributed system szenario, or in case of a standard system installation with all instances on one host. This Parameter is saved in the 'DEFAULT' profile. It is has no influence on language settings in a Java stack. Valid names are stored in a table of subcomponent 'NW_languagesInLoadChecks'. The available languages must be declaired in the 'LANGUAGES_IN_LOAD' parameter of the 'product.xml' file . In this file, the one-character representation of the languages is used. Check the same table in subcomponent 'NW_languagesInLoadChecks'. +# Human readable form of the default login language to be preselected in SAPGUI. This Parameter is potentially prompted in addition in the screen that also asks for the <SAPSID>. It is only prompted in systems that have an ABAP stack. It is prompted for installation but not for system copy. It is asked in those installations, that perform the ABAP load. That could be the database load installation in case of a distributed system scenario, or in case of a standard system installation with all instances on one host. This Parameter is saved in the 'DEFAULT' profile. It is has no influence on language settings in a Java stack. Valid names are stored in a table of subcomponent 'NW_languagesInLoadChecks'. The available languages must be declaired in the 'LANGUAGES_IN_LOAD' parameter of the 'product.xml' file . In this file, the one-character representation of the languages is used. Check the same table in subcomponent 'NW_languagesInLoadChecks'. # NW_GetSidNoProfiles.SAP_GUI_DEFAULT_LANGUAGE =