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 2021-03-16 15:44:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-shaptools (Old) and /work/SRC/openSUSE:Factory/.python-shaptools.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-shaptools" Tue Mar 16 15:44:47 2021 rev:18 rq:879096 version:0.3.11+git.1615795734.75f5f46 Changes: -------- --- /work/SRC/openSUSE:Factory/python-shaptools/python-shaptools.changes 2021-02-18 20:52:25.679440354 +0100 +++ /work/SRC/openSUSE:Factory/.python-shaptools.new.2401/python-shaptools.changes 2021-03-16 15:46:22.461225908 +0100 @@ -1,0 +2,6 @@ +Fri Mar 12 14:59:00 UTC 2021 - Xabier Arbulu <xarb...@suse.com> + +- Fix the HANA sidadm user creation to transform to lowercase + properly + +------------------------------------------------------------------- Old: ---- python-shaptools-0.3.11+git.1612877404.cfeb51c.tar.gz New: ---- python-shaptools-0.3.11+git.1615795734.75f5f46.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-shaptools.spec ++++++ --- /var/tmp/diff_new_pack.k8b6ck/_old 2021-03-16 15:46:22.901226592 +0100 +++ /var/tmp/diff_new_pack.k8b6ck/_new 2021-03-16 15:46:22.905226598 +0100 @@ -22,7 +22,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-shaptools -Version: 0.3.11+git.1612877404.cfeb51c +Version: 0.3.11+git.1615795734.75f5f46 Release: 0 Summary: Python tools to interact with SAP HANA utilities License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.k8b6ck/_old 2021-03-16 15:46:22.941226654 +0100 +++ /var/tmp/diff_new_pack.k8b6ck/_new 2021-03-16 15:46:22.941226654 +0100 @@ -5,7 +5,7 @@ <param name="exclude">.git</param> <param name="filename">python-shaptools</param> <param name="versionformat">@PARENT_TAG@+git.%ct.%h</param> - <param name="revision">cfeb51cedf38934b3981ab102f17d4f06ef15c6b</param> + <param name="revision">75f5f461d591f0d34c1ab24b1579ff1e64fc20c2</param> </service> <service name="recompress" mode="disabled"> ++++++ python-shaptools-0.3.11+git.1612877404.cfeb51c.tar.gz -> python-shaptools-0.3.11+git.1615795734.75f5f46.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/.codeclimate.yml new/python-shaptools-0.3.11+git.1615795734.75f5f46/.codeclimate.yml --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/.codeclimate.yml 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/.codeclimate.yml 2021-03-15 09:08:54.000000000 +0100 @@ -5,4 +5,4 @@ threshold: 8 file-lines: config: - threshold: 1024 + threshold: 1024 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/.github/workflows/shaptools-ci.yml new/python-shaptools-0.3.11+git.1615795734.75f5f46/.github/workflows/shaptools-ci.yml --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/.github/workflows/shaptools-ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/.github/workflows/shaptools-ci.yml 2021-03-15 09:08:54.000000000 +0100 @@ -0,0 +1,95 @@ +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] +env: + PACKAGE_NAME: python-shaptools + TAR_NAME: shaptools +jobs: + + test-python: + runs-on: ubuntu-18.04 + if: ${{ github.event_name != 'pull_request' }} + strategy: + matrix: + os: [ubuntu-18.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 + 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 + if: ${{ github.event_name != 'pull_request' }} + container: + image: shap/continuous_deliver + env: + OBS_USER: ${{ secrets.OBS_USER }} + 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 + + submit: + needs: [test-python, delivery] + runs-on: ubuntu-18.04 + if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} + container: + image: shap/continuous_deliver + env: + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASS: ${{ secrets.OBS_PASS }} + 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 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/.travis.yml new/python-shaptools-0.3.11+git.1615795734.75f5f46/.travis.yml --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/.travis.yml 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,68 +0,0 @@ -sudo: required -services: - - docker - -language: python - -stages: - - test - - delivery - - submit - -jobs: - include: - - stage: test - python: 2.7 - env: TOXENV=py27-codeclimate - install: - - pip install tox - script: - - tox - - - stage: test - python: 3.6 - env: TOXENV=py36-codeclimate - before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - install: - - pip install tox - script: - - tox - after_script: - - mv tests/coverage.xml . - - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT tests/coverage.xml - - - stage: delivery - if: (type != pull_request AND (branch = master or env(DELIVER_BRANCHES))) or tag IS present - env: - - PACKAGE_NAME=python-shaptools - - TAR_NAME=shaptools - - before_install: - - docker pull shap/continuous_deliver:latest - - script: - - | - docker run -t -v "$(pwd):/package" -w /package \ - -e OBS_USER -e OBS_PASS -e FOLDER -e OBS_PROJECT -e PACKAGE_NAME -e TAR_NAME \ - shap/continuous_deliver \ - /bin/bash -c "sed -i 's~%%VERSION%%~$TRAVIS_COMMIT~' _service && \ - sed -i 's~%%REPOSITORY%%~$TRAVIS_REPO_SLUG~' _service && \ - /scripts/upload.sh" - - - stage: submit - if: tag IS present - env: - - PACKAGE_NAME=python-shaptools - - before_install: - - docker pull shap/continuous_deliver:latest - - script: - - | - docker run -t -v "$(pwd):/package" -w /package \ - -e OBS_USER -e OBS_PASS -e FOLDER -e OBS_PROJECT -e PACKAGE_NAME -e TARGET_PROJECT \ - shap/continuous_deliver \ - /scripts/submit.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/README.md new/python-shaptools-0.3.11+git.1615795734.75f5f46/README.md --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/README.md 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/README.md 2021-03-15 09:08:54.000000000 +0100 @@ -1,6 +1,6 @@ -[](https://travis-ci.org/SUSE/shaptools) -[](https://codeclimate.com/github/SUSE/shaptools/test_coverage) -[](https://codeclimate.com/github/SUSE/shaptools/maintainability) +[](https://github.com/SUSE/shaptools/actions/workflows/shaptools-ci.yml) +[](https://codeclimate.com/github/SUSE/shaptools/maintainability) +[](https://codeclimate.com/github/SUSE/shaptools/test_coverage) # SHAPTOOLS @@ -59,5 +59,6 @@ ## Reviewers -*Pull request* preferred reviewers for this project: +_Pull request_ preferred reviewers for this project: + - Xabier Arbulu Insausti (xarb...@suse.com) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/python-shaptools.changes new/python-shaptools-0.3.11+git.1615795734.75f5f46/python-shaptools.changes --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/python-shaptools.changes 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/python-shaptools.changes 2021-03-15 09:08:54.000000000 +0100 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Mar 12 14:59:00 UTC 2021 - Xabier Arbulu <xarb...@suse.com> + +- Fix the HANA sidadm user creation to transform to lowercase + properly + +------------------------------------------------------------------- Tue Feb 9 13:26:18 UTC 2021 - Xabier Arbulu <xarb...@suse.com> - Fix spec file to build properly the shapcli executable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/shaptools/hana.py new/python-shaptools-0.3.11+git.1615795734.75f5f46/shaptools/hana.py --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/shaptools/hana.py 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/shaptools/hana.py 2021-03-15 09:08:54.000000000 +0100 @@ -84,8 +84,6 @@ 'x86_64', 'ppc64le' ] SUPPORTED_SYSTEMS = ['Linux'] - # SID is usualy written uppercased, but the OS user is always created lower case. - HANAUSER = '{sid}adm'.lower() SYNCMODES = ['sync', 'syncmem', 'async'] SUCCESSFULLY_REGISTERED = 0 # Node correctly registered as secondary node SSFS_DIFFERENT_ERROR = 149 # ssfs files are different in the two nodes error return code @@ -103,6 +101,13 @@ self._password = password self.remote_host = kwargs.get('remote_host', None) + @staticmethod + def sidadm_user(sid): + """ + Get sidadm user. `{sid}adm` in lower case + """ + return '{sid}adm'.format(sid=sid).lower() + @classmethod def get_platform(cls): """ @@ -178,7 +183,7 @@ stdout and stderr """ #TODO: Add absolute paths to hana commands using sid and inst number - user = self.HANAUSER.format(sid=self.sid) + user = self.sidadm_user(self.sid) result = shell.execute_cmd(cmd, user, self._password, self.remote_host) if exception and result.returncode != 0: @@ -193,7 +198,7 @@ Returns: bool: True if installed, False otherwise """ - user = self.HANAUSER.format(sid=self.sid) + user = self.sidadm_user(self.sid) try: result = shell.execute_cmd('HDB info', user, self._password, self.remote_host) return not result.returncode @@ -443,7 +448,7 @@ Args: primary_pass: Password of the primary node """ - user = self.HANAUSER.format(sid=self.sid) + user = self.sidadm_user(self.sid) sid_upper = self.sid.upper() cmd = \ "scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "\ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/shaptools/shapcli.py new/python-shaptools-0.3.11+git.1615795734.75f5f46/shaptools/shapcli.py --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/shaptools/shapcli.py 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/shaptools/shapcli.py 2021-03-15 09:08:54.000000000 +0100 @@ -230,7 +230,7 @@ hana_instance.sid, hana_instance.inst) response = input() if response == 'y': - user = hana.HanaInstance.HANAUSER.format(sid=hana_instance.sid) + user = hana.HanaInstance.sidadm_user(sid=hana_instance.sid) hana_instance.uninstall(user, hana_instance._password) else: logger.info('Command execution canceled') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/tests/hana_test.py new/python-shaptools-0.3.11+git.1615795734.75f5f46/tests/hana_test.py --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/tests/hana_test.py 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/tests/hana_test.py 2021-03-15 09:08:54.000000000 +0100 @@ -208,6 +208,19 @@ self.assertEqual(proc_mock, result) @mock.patch('shaptools.shell.execute_cmd') + def test_run_hana_command_uppercase(self, mock_execute): + proc_mock = mock.Mock() + proc_mock.returncode = 0 + + mock_execute.return_value = proc_mock + + self._hana = hana.HanaInstance('PRD', 1, 'pass') + result = self._hana._run_hana_command('test command') + + mock_execute.assert_called_once_with('test command', 'prdadm', 'pass', None) + self.assertEqual(proc_mock, result) + + @mock.patch('shaptools.shell.execute_cmd') def test_run_hana_command_error(self, mock_execute): proc_mock = mock.Mock() proc_mock.returncode = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-shaptools-0.3.11+git.1612877404.cfeb51c/tox.ini new/python-shaptools-0.3.11+git.1615795734.75f5f46/tox.ini --- old/python-shaptools-0.3.11+git.1612877404.cfeb51c/tox.ini 2021-02-09 14:30:04.000000000 +0100 +++ new/python-shaptools-0.3.11+git.1615795734.75f5f46/tox.ini 2021-03-15 09:08:54.000000000 +0100 @@ -1,6 +1,14 @@ # content of: tox.ini , put in same dir as setup.py [tox] -envlist = py{27,36} +envlist = py27, py36, py37, py38, py39 + +[gh-actions] +python = + 2.7: py27 + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 [base] deps = @@ -13,25 +21,7 @@ deps = {[base]deps} py27: mock - + commands = - py.test -vv --cov=shaptools --cov-config .coveragerc --cov-report term --cov-report html {posargs} + pytest -vv --cov=shaptools --cov-config .coveragerc --cov-report term --cov-report xml {posargs} -[testenv:py27-codeclimate] -passenv = TRAVIS TRAVIS_* -changedir=tests -deps = - {[base]deps} - mock - -commands = - py.test -vv --cov=shaptools --cov-config .coveragerc --cov-report term --cov-report xml {posargs} - -[testenv:py36-codeclimate] -passenv = TRAVIS TRAVIS_* -changedir=tests -deps = - {[base]deps} - -commands = - py.test -vv --cov=shaptools --cov-config .coveragerc --cov-report term --cov-report xml