adding changed deadline variable to all plugins

This commit is contained in:
Milan Kolar 2018-11-26 15:41:57 +01:00
parent 6b513027ab
commit 60a4c68fa5
2 changed files with 20 additions and 9 deletions

View file

@ -1,4 +1,5 @@
import pyblish.api
import os
import avalon.api as api
from avalon.vendor import requests
@ -14,14 +15,19 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
def process(self, instance):
AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
"http://localhost:8082")
# AVALON_DEADLINE = api.Session.get("AVALON_DEADLINE",
# "http://localhost:8082")
#
# assert AVALON_DEADLINE is not None, "Requires AVALON_DEADLINE"
assert AVALON_DEADLINE is not None, "Requires AVALON_DEADLINE"
try:
deadline_url = os.environ["DEADLINE_REST_URL"]
except KeyError:
self.log.error("Deadline REST API url not found.")
# Check response
response = requests.get(AVALON_DEADLINE)
response = requests.get(deadline_url)
assert response.ok, "Response must be ok"
assert response.text.startswith("Deadline Web Service "), (
"Web service did not respond with 'Deadline Web Service'"
)
)