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

Skip broken catalog brains in WorkflowSecurityUpdater. #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phgross
Copy link
Member

@phgross phgross commented Oct 8, 2018

Similar as it was done for self.objects (see #146), we now also skip broken brains when updating workflow_security via update_workflow_security. This should help to have workflow updates without difficulties.

Similar as it was done for self.objects (see #146), we now also skip
broken brains when updating workflow_security via
`update_workflow_security`.
@phgross phgross requested a review from jone October 8, 2018 09:27
except KeyError:
return None

generator = (lookup(brain) for brain in brains)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see two problems here:

  1. We are not uncataloging missing objects.
  2. This line does not filter None elements, so the length of the SizedGenerator in the next line is too big when there are broken brains.

Could we move catalog_unrestricted_get_object from the step class into a place where we can reuse it here, so that we can use the same code?
I'd then use the same code as in #146:

generator = (self.catalog_unrestricted_get_object(brain) for brain in brains)
generator = (obj for obj in generator if obj is not None)
return SizedGenerator(generator, len(brains))

@idgserpro
Copy link

Was this implemented by 1ba13db?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants