diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-10-14 13:57:33 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:39:51 +0000 |
commit | 298c3d52bab5cf38c37438c54853d6803ca194bd (patch) | |
tree | 2113944f04d337bc6a2ddfd2484f95ab7ea2d775 /bitbake/lib/toaster/bldcontrol/models.py | |
parent | 2837b110ae8fd5ff0ca3ac5959cadb7d4a5ce6cc (diff) | |
download | poky-298c3d52bab5cf38c37438c54853d6803ca194bd.tar.gz |
bitbake: toastergui: provide download file capability
We add, for the localhost environments, the capability to
download build artifacts. This is a pontentially dangerous API,
because it gives unrestricted read access to the build environment
file system - do not expose the functionality directly to the
web layer, but use filtering/translation code, such as
exemplified in the build_artifact view.
The capability for remote build environments is dependent
on bug 6835, as to use the collect storage as intermediary
storage for serving files.
[YOCTO #6834]
(Bitbake rev: 5fce7f6e83c6143244faa9618b7ed20c1106e08f)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/models.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/models.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py index df3635b331..15270c3a57 100644 --- a/bitbake/lib/toaster/bldcontrol/models.py +++ b/bitbake/lib/toaster/bldcontrol/models.py | |||
@@ -40,6 +40,19 @@ class BuildEnvironment(models.Model): | |||
40 | updated = models.DateTimeField(auto_now = True) | 40 | updated = models.DateTimeField(auto_now = True) |
41 | 41 | ||
42 | 42 | ||
43 | def get_artifact_type(self, path): | ||
44 | if self.betype == BuildEnvironment.TYPE_LOCAL: | ||
45 | import magic | ||
46 | m = magic.open(magic.MAGIC_MIME_TYPE) | ||
47 | m.load() | ||
48 | return m.file(path) | ||
49 | raise Exception("FIXME: not implemented") | ||
50 | |||
51 | def get_artifact(self, path): | ||
52 | if self.betype == BuildEnvironment.TYPE_LOCAL: | ||
53 | return open(path, "r") | ||
54 | raise Exception("FIXME: not implemented") | ||
55 | |||
43 | # a BuildRequest is a request that the scheduler will build using a BuildEnvironment | 56 | # a BuildRequest is a request that the scheduler will build using a BuildEnvironment |
44 | # the build request queue is the table itself, ordered by state | 57 | # the build request queue is the table itself, ordered by state |
45 | 58 | ||