Skip to content

Commit

Permalink
Fix log level in ssh and rename key methods
Browse files Browse the repository at this point in the history
  • Loading branch information
datamel committed Sep 16, 2020
1 parent 8fbf0d1 commit 3f57dce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion cylc/flow/cfgspec/globalcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@
similar interface to ``scp``.
''')
Conf('ssh command',
VDR.V_STRING, 'ssh -oBatchMode=yes -oConnectTimeout=10',
VDR.V_STRING,
'ssh -oBatchMode=yes -oConnectTimeout=10 -oLogLevel=error',
desc='''
A string for the command used to invoke commands on this host.
This is not used on the suite host unless you run local tasks
Expand Down
1 change: 0 additions & 1 deletion cylc/flow/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def construct_rsync_over_ssh_cmd(
dst_host = get_host_from_platform(platform)
rsync_cmd = "rsync -v --perms --recursive --links --checksum --delete"
ssh_cmd = platform['ssh command']
ssh_cmd = ssh_cmd + " -o LogLevel=error"
rsync_cmd = shlex.split(rsync_cmd)
rsync_cmd.append("--rsh=" + ssh_cmd)
# Note to future devs - be wary of changing the order of the following
Expand Down
12 changes: 6 additions & 6 deletions cylc/flow/task_remote_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
REMOTE_INIT_FAILED = 'REMOTE INIT FAILED'


def remove_keys_on_platform(srvd, install_target, full_clean=False):
"""Removes platform-held authentication keys"""
def remove_keys_on_client(srvd, install_target, full_clean=False):
"""Removes client authentication keys"""
keys = {
"client_private_key": KeyInfo(
KeyType.PRIVATE,
Expand All @@ -60,7 +60,7 @@ def remove_keys_on_platform(srvd, install_target, full_clean=False):
os.remove(k.full_key_path)


def create_platform_keys(srvd, install_target):
def create_client_keys(srvd, install_target):
"""Create or renew authentication keys for suite 'reg' in the .service
directory.
Generate a pair of ZMQ authentication keys"""
Expand Down Expand Up @@ -106,8 +106,8 @@ def remote_init(install_target, rund, indirect_comm=None):
# client key for a different install target exists
print(REMOTE_INIT_FAILED)
try:
remove_keys_on_platform(srvd, install_target)
create_platform_keys(srvd, install_target)
remove_keys_on_client(srvd, install_target)
create_client_keys(srvd, install_target)
except Exception:
# Catching all exceptions as need to fail remote init if any problems
# with key generation.
Expand Down Expand Up @@ -152,7 +152,7 @@ def remote_tidy(install_target, rund):
else:
if cylc.flow.flags.debug:
print('Deleted: %s' % fname)
remove_keys_on_platform(srvd, install_target, full_clean=True)
remove_keys_on_client(srvd, install_target, full_clean=True)
try:
os.rmdir(srvd) # remove directory if empty
except OSError:
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/key_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
KeyType,
remove_keys_on_server)
from cylc.flow.task_remote_cmd import (
remove_keys_on_platform, create_platform_keys)
remove_keys_on_client, create_client_keys)


def setup_keys(suite_name):
Expand All @@ -48,6 +48,6 @@ def setup_keys(suite_name):
suite_srv_dir=suite_srv_dir)
}
remove_keys_on_server(server_keys)
remove_keys_on_platform(suite_srv_dir, None, full_clean=True)
remove_keys_on_client(suite_srv_dir, None, full_clean=True)
create_server_keys(server_keys, suite_srv_dir)
create_platform_keys(suite_srv_dir, None)
create_client_keys(suite_srv_dir, None)

0 comments on commit 3f57dce

Please sign in to comment.