Skip to content

Commit

Permalink
Update cba_sync.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xzzy authored Aug 12, 2024
1 parent df7c3b9 commit f6aa3aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ledgergw/management/commands/cba_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def handle(self, *args, **options):
print ("removing "+lbf)
os.remove(local_bank_directory+lbf)

result = subprocess.check_output('echo "ls '+remote_bank_directory+'" | sftp -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
result = subprocess.check_output('echo "ls '+remote_bank_directory+'" | sftp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
sftpfiles = result.split("\n")
for file in sftpfiles:
sftp_file = file.strip()
Expand All @@ -53,7 +53,7 @@ def handle(self, *args, **options):
print ("File already exists not downloading "+file_only)
else:
print ('downloading file '+file_only)
get_resp = subprocess.check_output('echo "get '+sftp_file+' '+local_bank_directory+'" | sftp -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
get_resp = subprocess.check_output('echo "get '+sftp_file+' '+local_bank_directory+'" | sftp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True)
#print (get_resp)
os.remove('/tmp/bank.key')
except Exception as e:
Expand Down

0 comments on commit f6aa3aa

Please sign in to comment.