Add fixes for hound

This commit is contained in:
Vic Bartel 2022-03-25 10:33:23 +01:00
parent 521b56289d
commit 68941da3c8
2 changed files with 11 additions and 13 deletions

View file

@ -1,7 +1,9 @@
import os
import pyblish.api
from pymongo import MongoClient
from openpype.api import get_project_settings
from openpype.modules.shotgrid.lib.settings import get_shotgrid_project_settings
class CollectShotgridEntities(pyblish.api.ContextPlugin):
@ -64,12 +66,8 @@ def _get_shotgrid_collection(project):
return client.get_database("shotgrid_openpype").get_collection(project)
def _get_shotgrid_project_settings(project):
return get_project_settings(project).get("shotgrid", {})
def _get_shotgrid_project(avalon_project):
proj_settings = _get_shotgrid_project_settings(avalon_project["name"])
proj_settings = get_shotgrid_project_settings(avalon_project["name"])
shotgrid_project_id = proj_settings.get("shotgrid_project_id")
if shotgrid_project_id:
return {"type": "Project", "id": shotgrid_project_id}

View file

@ -1,10 +1,14 @@
import os
import pyblish.api
import shotgun_api3
from shotgun_api3.shotgun import AuthenticationFault
from openpype.lib import OpenPypeSettingsRegistry
from openpype.api import get_project_settings, get_system_settings
from openpype.modules.shotgrid.lib.settings import get_shotgrid_servers
from openpype.modules.shotgrid.lib.settings import (
get_shotgrid_servers,
get_shotgrid_project_settings,
)
class CollectShotgridSession(pyblish.api.ContextPlugin):
@ -40,7 +44,7 @@ class CollectShotgridSession(pyblish.api.ContextPlugin):
avalon_project = os.getenv("AVALON_PROJECT")
shotgrid_settings = get_shotgrid_settings(avalon_project)
shotgrid_settings = get_shotgrid_project_settings(avalon_project)
self.log.info("shotgrid settings: {}".format(shotgrid_settings))
shotgrid_servers_settings = get_shotgrid_servers()
self.log.info(
@ -111,10 +115,6 @@ def set_shotgrid_certificate(certificate):
os.environ["SHOTGUN_API_CACERTS"] = certificate
def get_shotgrid_settings(project):
return get_project_settings(project).get("shotgrid", {})
def get_login():
reg = OpenPypeSettingsRegistry()
try: