Skip to content

Commit

Permalink
Merge pull request #54 from arbulu89/hotfix/register-secondary
Browse files Browse the repository at this point in the history
Fix issue during secondary registration
  • Loading branch information
arbulu89 authored Aug 25, 2020
2 parents 6537616 + 5f7916f commit 94e944d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions python-shaptools.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Aug 25 06:53:29 UTC 2020 - Xabier Arbulu <[email protected]>

- Create version 0.3.9
- Fix issue when secondary registration fails after a successful
SSFS files copy process. Now the registration return code will
be checked in the new call (bsc#1175709)

-------------------------------------------------------------------
Fri Mar 27 18:15:37 UTC 2020 - Simranpal Singh <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion shaptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
:since: 2018-11-15
"""

__version__ = "0.3.8"
__version__ = "0.3.9"
3 changes: 1 addition & 2 deletions shaptools/hana.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,7 @@ def sr_register_secondary(
break
elif return_code == self.SSFS_DIFFERENT_ERROR:
self.copy_ssfs_files(remote_host, primary_pass)
self._run_hana_command(cmd)
break
continue
time.sleep(interval)
current_time = time.time()
continue
Expand Down
7 changes: 4 additions & 3 deletions tests/hana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,10 @@ def test_register_basic(self, mock_time):
def test_register_copy_ssfs(self, mock_time):
mock_time.return_value = 0
self._hana._run_hana_command = mock.Mock()
result_mock = mock.Mock(returncode=149)
result_error = mock.Mock(returncode=149)
result_good = mock.Mock(returncode=0)
self._hana.copy_ssfs_files = mock.Mock()
self._hana._run_hana_command.return_value = result_mock
self._hana._run_hana_command.side_effect = [result_error, result_good]
self._hana.sr_register_secondary('test', 'host', 1, 'sync', 'ops', primary_pass='pass')
self._hana._run_hana_command.assert_has_calls([
mock.call(
Expand All @@ -577,7 +578,7 @@ def test_register_copy_ssfs(self, mock_time):
mock.call(
'hdbnsutil -sr_register --name={} --remoteHost={} '\
'--remoteInstance={} --replicationMode={} --operationMode={}'.format(
'test', 'host', '01', 'sync', 'ops'))
'test', 'host', '01', 'sync', 'ops'), False)
])
self._hana.copy_ssfs_files.assert_called_once_with('host', 'pass')

Expand Down

0 comments on commit 94e944d

Please sign in to comment.