Account for the instance of submodules.pack.Packer #104184

Merged
Sybren A. Stüvel merged 5 commits from Nitin-Rawat-1/flamenco:104183-Error-submitting-job into main 2023-02-17 11:06:08 +01:00
Contributor

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.

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.
Nitin-Rawat-1 added 1 commit 2023-02-13 16:06:39 +01:00
Nitin-Rawat-1 added 1 commit 2023-02-14 06:01:22 +01:00
We need to do so, to handle both cases when object of PackTread class is initialised with `submodules.pack.Packer`(don't have `actual_checkout_length attribute) instance or `bat_shaman.Packer`(have `actual_checkout_length` attribute) instance.
Nitin-Rawat-1 added 1 commit 2023-02-14 06:05:31 +01:00
Sybren A. Stüvel requested changes 2023-02-14 10:22:16 +01:00
Sybren A. Stüvel left a comment
Owner

Thanks for the explanation, that makes reviewing much simpler :)

Just a few small notes. The approach I think is good, the implementation can be improved.

Thanks for the explanation, that makes reviewing much simpler :) Just a few small notes. The approach I think is good, the implementation can be improved.
@ -8,7 +8,6 @@ import logging
import queue
import threading
import typing

Please dont' include formatting changes. In general, cleanups of formatting (and other changes that don't alter the functionality) should be in a PR by themselves.

Please dont' include formatting changes. In general, cleanups of formatting (and other changes that don't alter the functionality) should be in a PR by themselves.
dr.sybren marked this conversation as resolved
@ -171,3 +168,1 @@
self.packer.actual_checkout_path,
self.packer.missing_files,
)
if isinstance(self.packer, submodules.pack.Packer):

I think the code can be simplified to:

msg = MsgDone(
    self.packer.output_path,
    self.packer.missing_files,
    getattr(self.packer, 'actual_checkout_path', None),
)

That way the entire if can go away, and it's no longer specific to a particular Packer implementation.

I think the code can be simplified to: ```py msg = MsgDone( self.packer.output_path, self.packer.missing_files, getattr(self.packer, 'actual_checkout_path', None), ) ``` That way the entire `if` can go away, and it's no longer specific to a particular `Packer` implementation.
dr.sybren marked this conversation as resolved
Nitin-Rawat-1 added 1 commit 2023-02-14 11:31:40 +01:00
Doing so removes the need to check for a particular implementation of `Packer` object using if-else statements.
Nitin-Rawat-1 added 1 commit 2023-02-14 11:53:39 +01:00
Formatting changes should have there own PR.

Thanks!

Thanks!

The job is still not getting submitted to the manager.

This I don't see. For me the job is submitted just fine, with this PR.

> The job is still not getting submitted to the manager. This I don't see. For me the job is submitted just fine, with this PR.
Author
Contributor

The job is still not getting submitted to the manager.

This I don't see. For me the job is submitted just fine, with this PR.

Now everything is fine it was an old comment I forgot to update.

> > The job is still not getting submitted to the manager. > > This I don't see. For me the job is submitted just fine, with this PR. > Now everything is fine it was an old comment I forgot to update.
Nitin-Rawat-1 changed title from Account for the instance of submodules.pack.Packer to WIP: Account for the instance of submodules.pack.Packer 2023-02-14 12:01:36 +01:00

Then please edit the description so that it's a proper commit message.

Then please edit the description so that it's a [proper commit message](https://wiki.blender.org/wiki/Style_Guide/Commit_Messages).
Nitin-Rawat-1 changed title from WIP: Account for the instance of submodules.pack.Packer to Account for the instance of submodules.pack.Packer 2023-02-16 13:53:50 +01:00
Nitin-Rawat-1 changed title from Account for the instance of submodules.pack.Packer to WIP: Account for the instance of submodules.pack.Packer 2023-02-16 13:55:07 +01:00
Nitin-Rawat-1 changed title from WIP: Account for the instance of submodules.pack.Packer to Account for the instance of submodules.pack.Packer 2023-02-16 13:55:54 +01:00
Sybren A. Stüvel merged commit 4efed64a77 into main 2023-02-17 11:06:08 +01:00
Sybren A. Stüvel approved these changes 2023-02-17 11:06:21 +01:00
Sybren A. Stüvel left a comment
Owner

Thanks for the patch!

Thanks for the patch!
Sybren A. Stüvel deleted branch 104183-Error-submitting-job 2023-02-17 11:06:28 +01:00
Sign in to join this conversation.
No description provided.