comment DSSKey and add ed25519

This commit is contained in:
Kévin Guérineau
2020-11-20 14:13:27 +01:00
committed by Denis Cardon
parent 82ca9dfa35
commit d079b542be
6 changed files with 45 additions and 39 deletions
+5 -4
View File
@@ -55,7 +55,8 @@ class backup_samba4(backup_generic):
try:
mykey = paramiko.RSAKey.from_private_key_file(self.private_key)
except paramiko.SSHException:
mykey = paramiko.DSSKey.from_private_key_file(self.private_key)
#mykey = paramiko.DSSKey.from_private_key_file(self.private_key)
mykey = paramiko.Ed25519Key.from_private_key_file(self.private_key)
self.ssh = paramiko.SSHClient()
self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
@@ -117,9 +118,9 @@ class backup_samba4(backup_generic):
stats['total_files_count']=1 + stats.get('total_files_count', 0)
stats['written_files_count']=1 + stats.get('written_files_count', 0)
stats['total_bytes']=os.stat(localpath).st_size + stats.get('total_bytes', 0)
stats['written_bytes']=os.stat(localpath).st_size + stats.get('written_bytes', 0)
stats['written_bytes']=os.stat(localpath).st_size + stats.get('written_bytes', 0)
stats['log'] = '%s "%s"' % (stats['log'] ,self.db_name)
stats['backup_location'] = self.dest_dir
stats['backup_location'] = self.dest_dir
stats['status']='RMTemp'
cmd = 'rm -f "%s"' % filepath
@@ -138,7 +139,7 @@ class backup_samba4(backup_generic):
filelist = os.listdir(self.backup_dir)
filelist.sort()
p = re.compile('^\d{8,8}-\d{2,2}h\d{2,2}m\d{2,2}$')
p = re.compile('^\d{8,8}-\d{2,2}h\d{2,2}m\d{2,2}$')
for item in filelist:
if p.match(item):
dir_name = os.path.join(self.backup_dir,item)