Hello community,

here is the log from the commit of package python-shaptools for 
openSUSE:Factory checked in at 2020-09-22 21:08:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-shaptools (Old)
 and      /work/SRC/openSUSE:Factory/.python-shaptools.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-shaptools"

Tue Sep 22 21:08:24 2020 rev:14 rq:835846 version:0.3.10+git.1600699158.46fca28

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-shaptools/python-shaptools.changes        
2020-08-28 21:22:29.888357314 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-shaptools.new.4249/python-shaptools.changes  
    2020-09-22 21:09:40.579850365 +0200
@@ -1,0 +2,10 @@
+Thu Sep  3 06:44:31 UTC 2020 - Xabier Arbulu <[email protected]>
+
+- Create version 0.3.10
+- Fix how HANA database is started and stopped to work in multi
+  host environment. sapcontrol commands are used instead of HDB
+  now
+
+  (jsc#SLE-4047)
+
+-------------------------------------------------------------------

Old:
----
  python-shaptools-0.3.9+git.1598342516.94e944d.tar.gz

New:
----
  python-shaptools-0.3.10+git.1600699158.46fca28.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-shaptools.spec ++++++
--- /var/tmp/diff_new_pack.7A8uac/_old  2020-09-22 21:09:44.167853505 +0200
+++ /var/tmp/diff_new_pack.7A8uac/_new  2020-09-22 21:09:44.171853508 +0200
@@ -22,7 +22,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-shaptools
-Version:        0.3.9+git.1598342516.94e944d
+Version:        0.3.10+git.1600699158.46fca28
 Release:        0
 Summary:        Python tools to interact with SAP HANA utilities
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.7A8uac/_old  2020-09-22 21:09:44.227853557 +0200
+++ /var/tmp/diff_new_pack.7A8uac/_new  2020-09-22 21:09:44.227853557 +0200
@@ -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">94e944d708f725b958c386394a97ac3b047c5158</param>
+    <param name="revision">46fca286447ff1ec41837553dd7a4e3b14be69ec</param>
   </service>
 
   <service name="recompress" mode="disabled">

++++++ python-shaptools-0.3.9+git.1598342516.94e944d.tar.gz -> 
python-shaptools-0.3.10+git.1600699158.46fca28.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-shaptools-0.3.9+git.1598342516.94e944d/python-shaptools.changes 
new/python-shaptools-0.3.10+git.1600699158.46fca28/python-shaptools.changes
--- old/python-shaptools-0.3.9+git.1598342516.94e944d/python-shaptools.changes  
2020-08-25 10:01:56.000000000 +0200
+++ new/python-shaptools-0.3.10+git.1600699158.46fca28/python-shaptools.changes 
2020-09-21 16:39:18.000000000 +0200
@@ -1,4 +1,14 @@
 -------------------------------------------------------------------
+Thu Sep  3 06:44:31 UTC 2020 - Xabier Arbulu <[email protected]>
+
+- Create version 0.3.10
+- Fix how HANA database is started and stopped to work in multi
+  host environment. sapcontrol commands are used instead of HDB
+  now
+
+  (jsc#SLE-4047)
+
+-------------------------------------------------------------------
 Tue Aug 25 06:53:29 UTC 2020 - Xabier Arbulu <[email protected]>
 
 - Create version 0.3.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-shaptools-0.3.9+git.1598342516.94e944d/shaptools/__init__.py 
new/python-shaptools-0.3.10+git.1600699158.46fca28/shaptools/__init__.py
--- old/python-shaptools-0.3.9+git.1598342516.94e944d/shaptools/__init__.py     
2020-08-25 10:01:56.000000000 +0200
+++ new/python-shaptools-0.3.10+git.1600699158.46fca28/shaptools/__init__.py    
2020-09-21 16:39:18.000000000 +0200
@@ -6,4 +6,4 @@
 :since: 2018-11-15
 """
 
-__version__ = "0.3.9"
+__version__ = "0.3.10"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-shaptools-0.3.9+git.1598342516.94e944d/shaptools/hana.py 
new/python-shaptools-0.3.10+git.1600699158.46fca28/shaptools/hana.py
--- old/python-shaptools-0.3.9+git.1598342516.94e944d/shaptools/hana.py 
2020-08-25 10:01:56.000000000 +0200
+++ new/python-shaptools-0.3.10+git.1600699158.46fca28/shaptools/hana.py        
2020-09-21 16:39:18.000000000 +0200
@@ -342,16 +342,32 @@
 
     def start(self):
         """
-        Start hana instance
+        Start hana instance.
+
+        Info: 'HDB start' is not used, as this command only operates in the 
local machine and
+        it does not start machines in other host. The used timeout and delay 
values are the same
+        used by 'HDB start'
         """
-        cmd = 'HDB start'
+        timeout = 2700
+        delay = 2
+        cmd = 'sapcontrol -nr {} -function StartSystem HDB'.format(self.inst)
+        self._run_hana_command(cmd)
+        cmd = 'sapcontrol -nr {} -function WaitforStarted {} 
{}'.format(self.inst, timeout, delay)
         self._run_hana_command(cmd)
 
     def stop(self):
         """
-        Stop hana instance
+        Stop hana instance.
+
+        Info: 'HDB stop' is not used, as this command only operates in the 
local machine and
+        it does not stop machines in other host. The used timeout and delay 
values are the same
+        used by 'HDB start'
         """
-        cmd = 'HDB stop'
+        timeout = 2700
+        delay = 2
+        cmd = 'sapcontrol -nr {} -function StopSystem HDB'.format(self.inst)
+        self._run_hana_command(cmd)
+        cmd = 'sapcontrol -nr {} -function WaitforStopped {} 
{}'.format(self.inst, timeout, delay)
         self._run_hana_command(cmd)
 
     def get_sr_state(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-shaptools-0.3.9+git.1598342516.94e944d/shaptools/netweaver.py 
new/python-shaptools-0.3.10+git.1600699158.46fca28/shaptools/netweaver.py
--- old/python-shaptools-0.3.9+git.1598342516.94e944d/shaptools/netweaver.py    
2020-08-25 10:01:56.000000000 +0200
+++ new/python-shaptools-0.3.10+git.1600699158.46fca28/shaptools/netweaver.py   
2020-09-21 16:39:18.000000000 +0200
@@ -243,7 +243,17 @@
                 cwd=' SAPINST_CWD={}'.format(cwd) if cwd else '')
         result = shell.execute_cmd(cmd, root_user, password, remote_host)
         if result.returncode and raise_exception:
-            raise NetweaverError('SAP Netweaver installation failed')
+            if cwd:
+                raise NetweaverError(
+                    'SAP Netweaver installation failed. Please check swpm 
installation logs'\
+                    '(sapinst_dev.log and sapinst.log) located at {0} for 
further '\
+                    'information'.format(cwd))
+            else:
+                raise NetweaverError(
+                    'SAP Netweaver installation failed.'\
+                    ' Please check swpm installation logs'\
+                    '(sapinst_dev.log and sapinst.log) located at'\
+                    ' /tmp/sapinst_instdir default folder for further 
information')
         return result
 
     @classmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-shaptools-0.3.9+git.1598342516.94e944d/tests/hana_test.py 
new/python-shaptools-0.3.10+git.1600699158.46fca28/tests/hana_test.py
--- old/python-shaptools-0.3.9+git.1598342516.94e944d/tests/hana_test.py        
2020-08-25 10:01:56.000000000 +0200
+++ new/python-shaptools-0.3.10+git.1600699158.46fca28/tests/hana_test.py       
2020-09-21 16:39:18.000000000 +0200
@@ -481,13 +481,19 @@
         mock_command = mock.Mock()
         self._hana._run_hana_command = mock_command
         self._hana.start()
-        mock_command.assert_called_once_with('HDB start')
+        mock_command.assert_has_calls([
+            mock.call('sapcontrol -nr {} -function StartSystem 
HDB'.format(self._hana.inst)),
+            mock.call('sapcontrol -nr {} -function WaitforStarted 2700 
2'.format(self._hana.inst))
+        ])
 
     def test_stop(self):
         mock_command = mock.Mock()
         self._hana._run_hana_command = mock_command
         self._hana.stop()
-        mock_command.assert_called_once_with('HDB stop')
+        mock_command.assert_has_calls([
+            mock.call('sapcontrol -nr {} -function StopSystem 
HDB'.format(self._hana.inst)),
+            mock.call('sapcontrol -nr {} -function WaitforStopped 2700 
2'.format(self._hana.inst))
+        ])
 
     @mock.patch('shaptools.shell.find_pattern', 
mock.Mock(return_value=object()))
     def test_get_sr_state_primary(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-shaptools-0.3.9+git.1598342516.94e944d/tests/netweaver_test.py 
new/python-shaptools-0.3.10+git.1600699158.46fca28/tests/netweaver_test.py
--- old/python-shaptools-0.3.9+git.1598342516.94e944d/tests/netweaver_test.py   
2020-08-25 10:01:56.000000000 +0200
+++ new/python-shaptools-0.3.10+git.1600699158.46fca28/tests/netweaver_test.py  
2020-09-21 16:39:18.000000000 +0200
@@ -345,6 +345,33 @@
         mock_remove_old_files.assert_called_once_with('/tmp', 'root', 'pass', 
None)
         mock_execute_cmd.assert_called_once_with(cmd, 'root', 'pass', None)
 
+    @mock.patch('shaptools.netweaver.NetweaverInstance._remove_old_files')
+    @mock.patch('shaptools.shell.execute_cmd')
+    def test_install_error_cwd(self, mock_execute_cmd, mock_remove_old_files):
+
+        result = mock.Mock(returncode=1)
+        mock_execute_cmd.return_value = result
+
+        with self.assertRaises(netweaver.NetweaverError) as err:
+            self._netweaver.install(
+                '/path', 'virtual', 'MYPRODUCT', '/inifile.params', 'root', 
'pass',
+                remote_host='remote', cwd='/tmp/swpm_unnattended')
+
+        mock_remove_old_files.assert_called_once_with(
+            '/tmp/swpm_unnattended', 'root', 'pass', 'remote')
+
+        cmd = '/path/sapinst SAPINST_USE_HOSTNAME=virtual '\
+            'SAPINST_EXECUTE_PRODUCT_ID=MYPRODUCT '\
+            'SAPINST_SKIP_SUCCESSFULLY_FINISHED_DIALOG=true 
SAPINST_START_GUISERVER=false '\
+            'SAPINST_INPUT_PARAMETERS_URL=/inifile.params 
SAPINST_CWD=/tmp/swpm_unnattended'
+
+        mock_execute_cmd.assert_called_once_with(cmd, 'root', 'pass', 'remote')
+
+        self.assertTrue(
+            'SAP Netweaver installation failed. Please check swpm installation 
'\
+            'logs(sapinst_dev.log and sapinst.log) located at 
/tmp/swpm_unnattended for further '\
+            'information' in str(err.exception))
+
     @mock.patch('shaptools.shell.execute_cmd')
     def test_install_error(self, mock_execute_cmd):
 
@@ -361,7 +388,11 @@
             'SAPINST_SKIP_SUCCESSFULLY_FINISHED_DIALOG=true 
SAPINST_START_GUISERVER=false '\
             'SAPINST_INPUT_PARAMETERS_URL=/inifile.params'
         mock_execute_cmd.assert_called_once_with(cmd, 'root', 'pass', 'remote')
-        self.assertTrue('SAP Netweaver installation failed' in 
str(err.exception))
+        self.assertTrue(
+            'SAP Netweaver installation failed. Please check swpm installation 
'\
+            'logs(sapinst_dev.log and sapinst.log) located at 
/tmp/sapinst_instdir default '\
+            'folder for further information' in str(err.exception))
+
 
     @mock.patch('shaptools.netweaver.shell.find_pattern')
     def test_ascs_restart_needed(self, mock_find_pattern):


Reply via email to