Fix error submitting job when not using Shaman

Fix #104183: Error submitting job to flamenco manager.

The bug happened when a user, using filesystem as storage solution,
would try to submit the job to the flamenco manager. The user would be shown
an Error -> Error packing with BAT: 'Packer' object has no attribute 'actual_checkout_path'.

The fix was to account for multiple implementations of the Packer object.

Reviewed-on: https://projects.blender.org/studio/flamenco/pulls/104184
This commit is contained in:
Nitin-Rawat-1 2023-02-17 11:06:07 +01:00 committed by Sybren A. Stüvel
parent eca498c98a
commit 4efed64a77

View File

@ -48,10 +48,10 @@ class MsgProgress(Message):
@dataclass @dataclass
class MsgDone(Message): class MsgDone(Message):
output_path: Path output_path: Path
"""Path of the submitted blend file, relative to the Shaman checkout root."""
actual_checkout_path: PurePosixPath
"""Shaman checkout path, i.e. the root of the job files, relative to the Shaman checkout root.""" """Shaman checkout path, i.e. the root of the job files, relative to the Shaman checkout root."""
missing_files: list[Path] missing_files: list[Path]
"""Path of the submitted blend file, relative to the Shaman checkout root."""
actual_checkout_path: Optional[PurePosixPath] = None
# MyPy doesn't understand the way BAT subpackages are imported. # MyPy doesn't understand the way BAT subpackages are imported.
@ -168,8 +168,8 @@ class PackThread(threading.Thread):
msg = MsgDone( msg = MsgDone(
self.packer.output_path, self.packer.output_path,
self.packer.actual_checkout_path,
self.packer.missing_files, self.packer.missing_files,
getattr(self.packer, "actual_checkout_path", None),
) )
self.queue.put(msg) self.queue.put(msg)