Merge pull request #607 from pypeclub/feature/publish_user_on_deadline

Deadline user defaults to pype username if present
This commit is contained in:
Milan Kolar 2020-10-06 15:06:37 +02:00 committed by GitHub
commit b999775ba0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View file

@ -13,7 +13,7 @@ class CollectCurrentUserPype(pyblish.api.ContextPlugin):
def process(self, context):
user = os.getenv("PYPE_USERNAME", "").strip()
if not user:
return
user = context.data.get("user", getpass.getuser())
context.data["user"] = user
self.log.debug("Pype user is \"{}\"".format(user))
self.log.debug("Colected user \"{}\"".format(user))

View file

@ -174,7 +174,8 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
"FTRACK_SERVER",
"PYPE_METADATA_FILE",
"AVALON_PROJECT",
"PYPE_LOG_NO_COLORS"
"PYPE_LOG_NO_COLORS",
"PYPE_USERNAME"
]
# custom deadline atributes
@ -297,6 +298,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
environment["PYPE_METADATA_FILE"] = roothless_metadata_path
environment["AVALON_PROJECT"] = io.Session["AVALON_PROJECT"]
environment["PYPE_LOG_NO_COLORS"] = "1"
environment["PYPE_USERNAME"] = instance.context.data["user"]
try:
environment["PYPE_PYTHON_EXE"] = os.environ["PYPE_PYTHON_EXE"]
except KeyError:

View file

@ -348,7 +348,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
comment = context.data.get("comment", "")
dirname = os.path.join(workspace, "renders")
renderlayer = instance.data['setMembers'] # rs_beauty
deadline_user = context.data.get("deadlineUser", getpass.getuser())
deadline_user = context.data.get("user", getpass.getuser())
jobname = "%s - %s" % (filename, instance.name)
# Get the variables depending on the renderer
@ -418,7 +418,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
# Adding file dependencies.
dependencies = instance.context.data["fileDependencies"]
dependencies.append(filepath)
if self.assembly_files:
if self.asset_dependencies:
for dependency in dependencies:
key = "AssetDependency" + str(dependencies.index(dependency))
payload_skeleton["JobInfo"][key] = dependency