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 e776c19 commit 00f7821
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion crmsh/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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 ocfs2
from . import qdevice
Expand Down
16 changes: 0 additions & 16 deletions crmsh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,22 +677,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

0 comments on commit 00f7821

Please sign in to comment.