Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_taskcluster_options():
"""
Helper to get the Taskcluster setup options
according to current environment (local or Taskcluster)
"""
options = taskcluster.optionsFromEnvironment()
proxy_url = os.environ.get("TASKCLUSTER_PROXY_URL")
if proxy_url is not None:
# Always use proxy url when available
options["rootUrl"] = proxy_url
if "rootUrl" not in options:
# Always have a value in root url
options["rootUrl"] = TASKCLUSTER_DEFAULT_URL
return options
def get_taskcluster_options():
"""
Helper to get the Taskcluster setup options
according to current environment (local or Taskcluster)
"""
options = taskcluster.optionsFromEnvironment()
proxy_url = os.environ.get("TASKCLUSTER_PROXY_URL")
if proxy_url is not None:
# Always use proxy url when available
options["rootUrl"] = proxy_url
if "rootUrl" not in options:
# Always have a value in root url
options["rootUrl"] = TASKCLUSTER_DEFAULT_URL
return options
def get_taskcluster_options():
"""
Helper to get the Taskcluster setup options
according to current environment (local or Taskcluster)
"""
options = taskcluster.optionsFromEnvironment()
proxy_url = os.environ.get("TASKCLUSTER_PROXY_URL")
if proxy_url is not None:
# Always use proxy url when available
options["rootUrl"] = proxy_url
if "rootUrl" not in options:
# Always have a value in root url
options["rootUrl"] = TASKCLUSTER_DEFAULT_URL
return options
email_buglist_string=email_buglist_string)
# On r-d, we prefix the subject of the email in order to simplify filtering
subject_prefix = ""
if product in {"fennec"}:
subject_prefix = "[mobile] "
if product in {"firefox", "devedition"}:
subject_prefix = "[desktop] "
subject = '{} Build of {} {} build {}'.format(subject_prefix, product, version, build_number)
# use proxy if configured, otherwise local credentials from env vars
if 'TASKCLUSTER_PROXY_URL' in os.environ:
notify_options = {'rootUrl': os.environ['TASKCLUSTER_PROXY_URL']}
else:
notify_options = optionsFromEnvironment()
notify = Notify(notify_options)
for address in addresses:
notify.email({
'address': address,
'subject': subject,
'content': content,
})