Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions coriolis/providers/replicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ def _copy_file(self, ssh, localPath, remotePath):
ssh, "sudo mv %s %s" % (tmp, remotePath), get_pty=True)
sftp.close()

@utils.retry_on_error()
def _copy_replicator_cmd(self, ssh):
local_path = os.path.join(
utils.get_resources_bin_dir(), 'replicator')
Expand Down Expand Up @@ -616,7 +615,6 @@ def _setup_replicator_user(self, ssh):
ssh, "sudo usermod -aG disk %s" % REPLICATOR_USERNAME,
get_pty=True)

@utils.retry_on_error()
def _exec_replicator(self, ssh, port, certs, state_file):
cmdline = ("%(replicator_path)s run -hash-method=%(hash_method)s "
"-ignore-mounted-disks=%(ignore_mounted)s "
Expand Down Expand Up @@ -738,7 +736,6 @@ def _change_binary_se_context(self, ssh):
LOG.warn("Could not change SELinux context of replicator binary. "
"Error was:%s", utils.get_exception_details())

@utils.retry_on_error()
def _setup_replicator(self, ssh):
# copy the binary, set up the service, generate certificates,
# start service
Expand Down
17 changes: 4 additions & 13 deletions coriolis/tests/providers/test_replicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,7 @@ def test__copy_file(self, mock_exec_ssh_cmd, mock_from_transport,
def test__copy_replicator_cmd(
self, mock_exec_ssh_cmd, mock_copy_file,
mock_get_resources_bin_dir, mock_join):
original_copy_replicator_cmd = testutils.get_wrapped_function(
self.replicator._copy_replicator_cmd)

original_copy_replicator_cmd(self.replicator, self._ssh)
self.replicator._copy_replicator_cmd(self._ssh)

mock_get_resources_bin_dir.assert_called_once()
mock_join.assert_called_once_with(
Expand Down Expand Up @@ -895,11 +892,8 @@ def test__exec_replicator_cmd(self, mock_create_service):
"srv_crt": mock.sentinel.srv_crt,
"srv_key": mock.sentinel.srv_key,
}
original_exec_replicator = testutils.get_wrapped_function(
self.replicator._exec_replicator)

original_exec_replicator(
self.replicator, self._ssh, self.conn_info['port'], certs,
self.replicator._exec_replicator(
self._ssh, self.conn_info['port'], certs,
mock.sentinel.state)

mock_create_service.assert_called_once_with(
Expand Down Expand Up @@ -997,10 +991,7 @@ def test__setup_replicator(
mock_get_replicator_state_file):
mock_setup_replicator_group.return_value = True

original_setup_replicator = testutils.get_wrapped_function(
self.replicator._setup_replicator)

result = original_setup_replicator(self.replicator, self._ssh)
result = self.replicator._setup_replicator(self._ssh)

mock_get_replicator_state_file.assert_called_once()
mock_copy_file.assert_called_once_with(
Expand Down
4 changes: 0 additions & 4 deletions coriolis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ def _has_systemd(ssh):
test_ssh_path(ssh, "/usr/lib/systemd/system"))


@retry_on_error()
def create_service(ssh, cmdline, svcname, run_as=None, start=True):
# Simplistic check for init system. We usually use official images,
# and none of the supported operating systems come with both upstart
Expand All @@ -863,7 +862,6 @@ def create_service(ssh, cmdline, svcname, run_as=None, start=True):
"could not determine init system")


@retry_on_error()
def restart_service(ssh, svcname):
if _has_systemd(ssh):
exec_ssh_cmd(ssh, "sudo systemctl restart %s" % svcname, get_pty=True)
Expand All @@ -873,7 +871,6 @@ def restart_service(ssh, svcname):
raise exception.UnrecognizedWorkerInitSystem()


@retry_on_error()
def start_service(ssh, svcname):
if _has_systemd(ssh):
exec_ssh_cmd(ssh, "sudo systemctl start %s" % svcname, get_pty=True)
Expand All @@ -883,7 +880,6 @@ def start_service(ssh, svcname):
raise exception.UnrecognizedWorkerInitSystem()


@retry_on_error()
def stop_service(ssh, svcname):
if _has_systemd(ssh):
exec_ssh_cmd(ssh, "sudo systemctl stop %s" % svcname, get_pty=True)
Expand Down
Loading