Skip to content

Commit

Permalink
Merge pull request #728 from ynput/bugfix/AY-1232_Dirmap-does-not-wor…
Browse files Browse the repository at this point in the history
…k-with-sitesync

Fix: dirmap wasn't using local site values
  • Loading branch information
kalisp authored Jul 3, 2024
2 parents 5640c81 + 2b89900 commit a969d00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
20 changes: 8 additions & 12 deletions client/ayon_core/host/dirmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from ayon_core.lib import Logger
from ayon_core.addon import AddonsManager
from ayon_core.settings import get_project_settings
from ayon_core.settings.lib import get_site_local_overrides


@six.add_metaclass(ABCMeta)
Expand Down Expand Up @@ -163,7 +162,7 @@ def _get_local_sync_dirmap(self):
if (
sitesync_addon is None
or not sitesync_addon.enabled
or project_name not in sitesync_addon.get_enabled_projects()
or not sitesync_addon.is_project_enabled(project_name, True)
):
return mapping

Expand All @@ -181,17 +180,14 @@ def _get_local_sync_dirmap(self):
exclude_locals=False,
cached=False)

# TODO implement
# Dirmap is dependent on 'get_site_local_overrides' which
# is not implemented in AYON. The mapping should be received
# from sitesync addon.
active_overrides = get_site_local_overrides(
# overrides for roots set in `Site Settings`
active_roots = sitesync_addon.get_site_root_overrides(
project_name, active_site)
remote_overrides = get_site_local_overrides(
remote_roots = sitesync_addon.get_site_root_overrides(
project_name, remote_site)

self.log.debug("local overrides {}".format(active_overrides))
self.log.debug("remote overrides {}".format(remote_overrides))
self.log.debug("active roots overrides {}".format(active_roots))
self.log.debug("remote roots overrides {}".format(remote_roots))

current_platform = platform.system().lower()
remote_provider = sitesync_addon.get_provider_for_site(
Expand All @@ -201,9 +197,9 @@ def _get_local_sync_dirmap(self):
# won't be root on cloud or sftp provider
if remote_provider != "local_drive":
remote_site = "studio"
for root_name, active_site_dir in active_overrides.items():
for root_name, active_site_dir in active_roots.items():
remote_site_dir = (
remote_overrides.get(root_name)
remote_roots.get(root_name)
or sync_settings["sites"][remote_site]["root"][root_name]
)

Expand Down
16 changes: 0 additions & 16 deletions client/ayon_core/settings/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,6 @@ def get_addon_versions(cls):
return cache_item.get_value()


def get_site_local_overrides(project_name, site_name, local_settings=None):
"""Site overrides from local settings for passet project and site name.
Deprecated:
This function is not implemented for AYON and will be removed.
Args:
project_name (str): For which project are overrides.
site_name (str): For which site are overrides needed.
local_settings (dict): Preloaded local settings. They are loaded
automatically if not passed.
"""

return {}


def get_ayon_settings(project_name=None):
"""AYON studio settings.
Expand Down

0 comments on commit a969d00

Please sign in to comment.