-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add slapcomp compatibility #5
base: master
Are you sure you want to change the base?
Changes from 9 commits
d92ad10
d2363a1
564df18
bcc7b8c
88662d1
3793eec
6df9853
0528d2e
02a4bc0
03226f4
6540062
865eac3
bd01af9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .app import show | ||
|
||
|
||
__all__ = [ | ||
"show" | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,35 @@ | |
|
||
import logging | ||
|
||
import avalon | ||
import os | ||
|
||
from avalon import io, api, pipeline | ||
from avalon.vendor import requests | ||
|
||
|
||
log = logging.getLogger("DSS - Lib") | ||
|
||
|
||
def get_work_directory(): | ||
"""Get the work directory to Fusion through the template""" | ||
|
||
session = api.Session.copy() | ||
project = io.find_one({"type": "project", | ||
"name": api.Session["AVALON_PROJECT"]}) | ||
assert project, "This is a bug" | ||
template = project["config"]["template"]["work"] | ||
|
||
session["AVALON_TASK"] = "comp" | ||
session["AVALON_APP"] = "fusion" | ||
work_directory = pipeline._format_work_template(template, session) | ||
|
||
if not os.path.isdir(work_directory): | ||
print("Fusion app folder does not exist:\n%s" % work_directory) | ||
work_directory = pipeline._format_work_template(template, api.Session) | ||
|
||
return work_directory | ||
|
||
|
||
def query(argument): | ||
"""Lazy wrapper for request.get""" | ||
|
||
|
@@ -29,21 +51,21 @@ def query(argument): | |
|
||
def get_machine_list(debug=None): | ||
"""Fetch the machine list (slaves) from Deadline""" | ||
AVALON_SESSION = debug or avalon.Session["AVALON_DEADLINE"] | ||
AVALON_SESSION = debug or api.Session["AVALON_DEADLINE"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make more sense to call this variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LOL, this slipped in without me even noticing. I know I wanted to call it AVALON_DEADLINE :') |
||
argument = "{}/api/slaves?NamesOnly=true".format(AVALON_SESSION) | ||
return query(argument=argument) | ||
|
||
|
||
def get_pool_list(debug=None): | ||
"""Get all pools from Deadline""" | ||
AVALON_SESSION = debug or avalon.Session["AVALON_DEADLINE"] | ||
AVALON_SESSION = debug or api.Session["AVALON_DEADLINE"] | ||
argument = "{}/api/pools?NamesOnly=true".format(AVALON_SESSION) | ||
return query(argument) | ||
|
||
|
||
def get_group_list(debug=None): | ||
"""Get all groups from Deadline""" | ||
AVALON_SESSION = debug or avalon.Session["AVALON_DEADLINE"] | ||
AVALON_SESSION = debug or api.Session["AVALON_DEADLINE"] | ||
argument = "{}/api/groups?NamesOnly=true".format(AVALON_SESSION) | ||
return query(argument) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, sorry @aardschok - noticed just right now there are actually much more variables with
brows
instead ofbrowse
- this line and the lines below (45 to 54, 120, 131)