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

Register host-specific Deadline plugins only on install of the host #6

Merged
19 changes: 15 additions & 4 deletions client/ayon_deadline/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from .version import __version__


DEADLINE_ADDON_DIR = os.path.dirname(os.path.abspath(__file__))
BigRoy marked this conversation as resolved.
Show resolved Hide resolved


class DeadlineWebserviceError(Exception):
"""
Exception to throw when connection to Deadline server fails.
Expand Down Expand Up @@ -37,10 +40,18 @@ def initialize(self, studio_settings):

def get_plugin_paths(self):
"""Deadline plugin paths."""
current_dir = os.path.dirname(os.path.abspath(__file__))
return {
"publish": [os.path.join(current_dir, "plugins", "publish")]
}
# Note: We are not returning `publish` key because we have overridden
# `get_publish_plugin_paths` to return paths host-specific. However,
# `get_plugin_paths` still needs to be implemented because it's
# abstract on the parent class
return {}

def get_publish_plugin_paths(self, host_name=None):
publish_dir = os.path.join(DEADLINE_ADDON_DIR, "plugins", "publish")
BigRoy marked this conversation as resolved.
Show resolved Hide resolved
paths = [os.path.join(publish_dir, "global")]
if host_name:
paths.append(os.path.join(publish_dir, host_name))
return paths

@staticmethod
def get_deadline_pools(webservice, auth=None, log=None):
Expand Down