From 1edd60afebbece12ff3941b1ab5caab72bf80da2 Mon Sep 17 00:00:00 2001 From: nicholasyang Date: Wed, 9 Oct 2024 15:15:27 +0800 Subject: [PATCH] unused code removal --- crmsh/bootstrap.py | 2 +- crmsh/utils.py | 18 +----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py index ed606db18..abf17b292 100644 --- a/crmsh/bootstrap.py +++ b/crmsh/bootstrap.py @@ -34,7 +34,7 @@ from . import tmpfiles from . import lock from . import userdir -from .constants import SSH_OPTION, QDEVICE_HELP_INFO, STONITH_TIMEOUT_DEFAULT,\ +from .constants import QDEVICE_HELP_INFO, STONITH_TIMEOUT_DEFAULT,\ REJOIN_COUNT, REJOIN_INTERVAL, PCMK_DELAY_MAX, CSYNC2_SERVICE, WAIT_TIMEOUT_MS_DEFAULT from . import qdevice from . import parallax diff --git a/crmsh/utils.py b/crmsh/utils.py index fc9affe9f..36fdb1b27 100644 --- a/crmsh/utils.py +++ b/crmsh/utils.py @@ -699,22 +699,6 @@ def str2file(s, fname, mod=0o644): return False return True -def write_remote_file(text, tofile, user, remote): - shell_script = f'''cat >> {tofile} << EOF -{text} -EOF -''' - result = sh.cluster_shell().subprocess_run_without_input( - remote, - user, - shell_script, - stdout=subprocess.DEVNULL, - stderr=subprocess.PIPE, - ) - if result.returncode != 0: - raise ValueError("Failed to write to {}@{}/{}: {}".format(user, remote, tofile, result.stdout.decode('utf-8'))) - - def copy_remote_textfile(remote_user, remote_node, remote_text_file, local_path): """ scp might lack permissions to copy the file for a non-root user. @@ -2341,7 +2325,7 @@ def get_interfaces_info(self): def flatten_custom_nic_addr_list(self) -> None: """ - If NIC or IP is provided by the -i option, convert them to + If NIC or IP is provided by the -i option, convert them to nic list and address list, and do some validations """ for item in self._custom_nic_addr_list: