Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update samba Modul #1187

Merged
merged 19 commits into from
Nov 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/modules/backup_clouds/samba/backup_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ def upload_backup(config: SambaBackupCloudConfiguration, backup_filename: str, b
if conn.connect(config.smb_server, 139):
log.info("SMB Verbindungsaufbau erfolgreich")
full_file_path = config.smb_path + backup_filename if config.smb_path is not None else backup_filename
log.info("Backup nach //" + config.smb_server + '/' + config.smb_share + full_file_path)
conn.storeFile(config.smb_share, full_file_path, io.BytesIO(backup_file))
log.info("Backup nach //" + config.smb_server + '/' + config.smb_share + '/' + full_file_path)
try:
conn.storeFile(config.smb_share, full_file_path, io.BytesIO(backup_file))
except Exception as error:
Saharel001 marked this conversation as resolved.
Show resolved Hide resolved
log.error(error.__str__().split('\n')[0])
log.error("Möglicherweise ist die Freigabe oder ein Unterordner nicht vorhanden")
conn.close()
else:
log.warn("SMB Verbindungsaufbau fehlgeschlagen")
Expand Down