diff options
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index c3e9b74c09..718e1441dc 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | |||
@@ -77,31 +77,11 @@ class Command(NoArgsCommand): | |||
77 | bec.be.save() | 77 | bec.be.save() |
78 | 78 | ||
79 | def archive(self): | 79 | def archive(self): |
80 | ''' archives data from the builds ''' | ||
81 | artifact_storage_dir = ToasterSetting.objects.get(name="ARTIFACTS_STORAGE_DIR").value | ||
82 | for br in BuildRequest.objects.filter(state = BuildRequest.REQ_ARCHIVE): | 80 | for br in BuildRequest.objects.filter(state = BuildRequest.REQ_ARCHIVE): |
83 | # save cooker log | ||
84 | if br.build == None: | 81 | if br.build == None: |
85 | br.state = BuildRequest.REQ_FAILED | 82 | br.state = BuildRequest.REQ_FAILED |
86 | br.save() | 83 | else: |
87 | continue | 84 | br.state = BuildRequest.REQ_COMPLETED |
88 | build_artifact_storage_dir = os.path.join(artifact_storage_dir, "%d" % br.build.pk) | ||
89 | try: | ||
90 | os.makedirs(build_artifact_storage_dir) | ||
91 | except OSError as ose: | ||
92 | if "File exists" in str(ose): | ||
93 | pass | ||
94 | else: | ||
95 | raise ose | ||
96 | |||
97 | file_name = os.path.join(build_artifact_storage_dir, "cooker_log.txt") | ||
98 | try: | ||
99 | with open(file_name, "w") as f: | ||
100 | f.write(br.environment.get_artifact(br.build.cooker_log_path).read()) | ||
101 | except IOError: | ||
102 | os.unlink(file_name) | ||
103 | |||
104 | br.state = BuildRequest.REQ_COMPLETED | ||
105 | br.save() | 85 | br.save() |
106 | 86 | ||
107 | def cleanup(self): | 87 | def cleanup(self): |