Skip to content

Commit

Permalink
version 0.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Berenz committed Oct 28, 2024
1 parent f38b76f commit 4eabf22
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nightskycam/utils/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,18 @@ def _inform_server(
stdout = result.stdout.strip()

stdout_file: Optional[Path]
stdout_file_exists = False
try:
stdout_file = Path(stdout)
stdout_file_exists = stdout_file.is_file()
except OSError as e:
# some strings can not be "cast" as path
stdout_file = None

if ftp_config and stdout_file.is_file():
if ftp_config and stdout_file_exists:
with get_ftp(ftp_config, ftp_config.folder) as ftp:
uploaded_size = ftp.upload(stdout_file, True)
result.stdout = Path(stdout).name
result.stdout = stdout_file.name

message = serialize_command_result(result, token=token)
self.send(url, message, status=status, cert_file=cert_file)
Expand Down

0 comments on commit 4eabf22

Please sign in to comment.