mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #420 from pypeclub/bugfix/cleanup-staging-dir-not-set
Cleanup plugin fail on instances without staging dir
This commit is contained in:
commit
78d8337029
1 changed files with 5 additions and 1 deletions
|
|
@ -71,12 +71,16 @@ class CleanUp(pyblish.api.InstancePlugin):
|
|||
temp_root = tempfile.gettempdir()
|
||||
staging_dir = instance.data.get("stagingDir", None)
|
||||
|
||||
if not staging_dir:
|
||||
self.log.info("Staging dir not set.")
|
||||
return
|
||||
|
||||
if not os.path.normpath(staging_dir).startswith(temp_root):
|
||||
self.log.info("Skipping cleanup. Staging directory is not in the "
|
||||
"temp folder: %s" % staging_dir)
|
||||
return
|
||||
|
||||
if not staging_dir or not os.path.exists(staging_dir):
|
||||
if not os.path.exists(staging_dir):
|
||||
self.log.info("No staging directory found: %s" % staging_dir)
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue