-
Notifications
You must be signed in to change notification settings - Fork 36
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
Remove multi-context restrictions for publishing image sequences on farm #42
Conversation
# set context by first json file | ||
ctx = self._context.data | ||
|
||
ctx["asset"] = ctx.get("asset") or data.get("asset") | ||
ctx["intent"] = ctx.get("intent") or data.get("intent") | ||
ctx["comment"] = ctx.get("comment") or data.get("comment") | ||
ctx["user"] = ctx.get("user") or data.get("user") | ||
ctx["version"] = ctx.get("version") or data.get("version") | ||
|
||
# basic sanity check to see if we are working in same context | ||
# if some other json file has different context, bail out. | ||
ctx_err = "inconsistent contexts in json files - %s" | ||
assert ctx.get("asset") == data.get("asset"), ctx_err % "asset" | ||
assert ctx.get("intent") == data.get("intent"), ctx_err % "intent" | ||
assert ctx.get("comment") == data.get("comment"), ctx_err % "comment" | ||
assert ctx.get("user") == data.get("user"), ctx_err % "user" | ||
assert ctx.get("version") == data.get("version"), ctx_err % "version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically - when is this is valid. If I have two .json
files that specify a different running context
to publish in this may be very dangerous because now suddenly that context isn't actually used for ONE of the json files?
I think, yes we should not assert that instance context must MATCH the gloibal context - but if we were to load multiple JSON files at once we should still assert the global context of both JSON files is shared between them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BigRoy this is just a port. Could you comment on the original PR; ynput/OpenPype#6088 ?
Implemented by #138 |
Changelog Description
Port of ynput/OpenPype#6088