Skip to content

Commit f89d9e2

Browse files
committed
fix attribute hostkeys
1 parent 2b68f8c commit f89d9e2

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

ludwig/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
def add_ssh_config():
2323
"""
24-
append contents of /media/ludwig_data/.ludwig/config to ~/.ssh/ludwig_config
24+
copy content of <ludwig_data_path>/.ludwig/config to ~/.ssh/ludwig_config.
25+
26+
note: this file contains the hostnames of Ludwig workers and their corresponding IP addresses.
2527
"""
2628
src = configs.WorkerDirs.ludwig_data / '.ludwig' / 'config'
2729
dst = Path().home() / '.ssh' / 'ludwig_config' # do not overwrite existing config
@@ -135,7 +137,7 @@ def submit():
135137
required=False,
136138
help='Whether to upload jobs to Ludwig. Set false for testing')
137139
parser.add_argument('-s', '--skip-hostkey', action='store_true', dest='skip_hostkey',
138-
required=False,
140+
required=False, default=False,
139141
help='Whether to skip hostkey checking. Unsafe, but may prevent SSH connection error.')
140142
namespace = parser.parse_args()
141143

ludwig/uploader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def to_disk(self,
8787

8888
def start_jobs(self,
8989
worker: str,
90-
skip_hostkey: bool, # True if skipping hostkey check (not safe)
90+
skip_hostkey: bool = False, # True if skipping hostkey check (not safe)
9191
) -> None:
9292
"""
9393
source code is uploaded.
@@ -118,12 +118,12 @@ def start_jobs(self,
118118
cnopts = pysftp.CnOpts()
119119
if skip_hostkey:
120120
print('WARNING: Skipping hostkey check. Known hosts will not be consulted')
121-
cnopts.hostkey = None
121+
cnopts.hostkeys = None
122122

123123
# connect via sftp
124124
ludwig_data_path = self.project_path.parent
125125
private_key_path = ludwig_data_path / '.ludwig' / 'id_rsa'
126-
print(f'Looking for private key path in {private_key_path}')
126+
print(f'Looking for private key in {private_key_path}')
127127
if not private_key_path.exists():
128128
raise OSError(f'Did not find {private_key_path}')
129129
sftp = pysftp.Connection(username='ludwig',

0 commit comments

Comments
 (0)