Skip to content

Commit

Permalink
update locations.json and sshfs_mounter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
talosh committed Jan 4, 2023
1 parent 0057b45 commit f28a453
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/locations.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
{
"user@machine": "dladmin@10.1.16.30",
"remote_folders": ["/Volumes/"],
"local_folders": ["/Volumes/", "/vol/flux1-images/solaar/"],
"remote_locations": {"/Volumes/": "hiupizda"},
"local_locations": ["/Volumes/", "/vol/flux1-images/solaar/"],
"identity_file": "/etc/ssh/ssh_host_rsa_key",
"exclude_folders": [
"Macintosh HD",
Expand Down
10 changes: 9 additions & 1 deletion sshfs_mounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ def get_config_data(config_folder_path):
if "IdentityFile" not in mount_options:
mount_options += ',IdentityFile=' + identity_file
print (mount_options)

remote_locations = location.get('remote_locations')
if not remote_locations:
remote_locations = []
elif isinstance(remote_locations, str):
remote_locations = [remote_locations]
elif not isinstance(remote_locations, list):
print ('remote locations should be list but found %s' % type(location))
remote_locations = []

args = ['ssh']
if identity_file:
args.append('-i')
Expand Down

0 comments on commit f28a453

Please sign in to comment.