Commit 6f590c71 authored by intrigeri's avatar intrigeri
Browse files

Don't manipulate __dict__ directly: instead {load into,dump from} the job attribute.

parent 068f3d04
......@@ -18,8 +18,7 @@ class BuildTailsISOJob:
assert type(branch['base_branch']) is bool
assert type(snippet) is str
assert snippet.__len__() > 0
base = yaml.safe_load(snippet)
self.__dict__.update(**base[0])
self.job = yaml.safe_load(snippet)
self.job['name'] = "build_Tails_ISO_" + branch['job_name']
self.job['scm'] = [{'git': \
{'branches': [branch['branch_name']],
......@@ -31,7 +30,7 @@ class BuildTailsISOJob:
self.job['publishers'] = [{'email': { 'recipients': self.TAILS_RM_EMAIL}}]
def __str__(self):
return yaml.safe_dump([self.__dict__], default_flow_style=False)
return yaml.safe_dump([{'job': self.job}], default_flow_style=False)
def get_active_branches():
......@@ -48,20 +47,19 @@ def get_active_branches():
]
JOB_SNIPPET = '''- job:
node: isobuilder1 || isobuilder2
builders:
- build_Tails_ISO
- clean_Archives
triggers:
- pollscm: '@weekly'
- timed: '@daily'
wrappers:
- timestamps
- workspace-cleanup:
dirmatch: true
include:
- "**"'''
JOB_SNIPPET = '''node: isobuilder1 || isobuilder2
builders:
- build_Tails_ISO
- clean_Archives
triggers:
- pollscm: '@weekly'
- timed: '@daily'
wrappers:
- timestamps
- workspace-cleanup:
dirmatch: true
include:
- "**"'''
if __name__ == "__main__":
for branch in get_active_branches():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment