Make data an optional argument, and only try to pull values from it if it is passed.

master
Simon Quigley 5 years ago
parent 685228adfc
commit 4e384845a2

@ -110,7 +110,7 @@ class Generator:
return server return server
def load_config(self, job_type, data): def load_config(self, job_type, data=None):
"""Return a template that is a result of loading the data """Return a template that is a result of loading the data
This makes it easier to standardize several types of jobs This makes it easier to standardize several types of jobs
@ -124,11 +124,12 @@ class Generator:
template += text template += text
template = Template(template) template = Template(template)
url = data["packaging_url"] if data:
u_branch = data["packaging_branch_unstable"] url = data["packaging_url"]
s_branch = data["packaging_branch_stable"] u_branch = data["packaging_branch_unstable"]
u_upload_target = data["upload_target_unstable"] s_branch = data["packaging_branch_stable"]
s_upload_target = data["upload_target_stable"] u_upload_target = data["upload_target_unstable"]
s_upload_target = data["upload_target_stable"]
if job_type.startswith("package"): if job_type.startswith("package"):
upstream = data["upstream_url"] upstream = data["upstream_url"]

Loading…
Cancel
Save