Skip to content

Commit

Permalink
unused code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Nov 12, 2024
1 parent 7b97a22 commit 1edd60a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion crmsh/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 1 addition & 17 deletions crmsh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1edd60a

Please sign in to comment.