Bug 1077251
Summary: | RFE: Make distro and friends available in kickstart as well | ||
---|---|---|---|
Product: | [Retired] Beaker | Reporter: | Alexander Todorov <atodorov> |
Component: | general | Assignee: | Dan Callaghan <dcallagh> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | tools-bugs <tools-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 0.16 | CC: | aigao, asaha, dcallagh, dowang, tools-bugs |
Target Milestone: | 20.0 | Keywords: | FutureFeature, NeedsTestCase, Patch |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-04-20 02:23:11 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Alexander Todorov
2014-03-17 15:07:33 UTC
Those model objects are intentionally not exposed to user-supplied templates, because Jinja lets the template call arbitrary methods on the objects. The code does attempt to prevent changes being committed to the db but it may not be perfect. Also there are other operations which are exposed as model methods, so a user template might be able to accidentally or maliciously do things like send e-mails. They are different than the ordinary ksmeta variables which are just strings or bools. We could probably make a fake version of the distro, distro_tree, and system model objects appear in the context for user templates and that would be enough for all sensible use cases. Hi Dan, at the moment we have templates which rely on the following: * CPU arch * OS major * OS family * OS variant without corresponding info in ks_meta they can't be rewritten to be rendered on the server. I'm fine with a few extra variables in ks_meta if this is the only way to resolve it. I'll see if I can send a patch for that. I would rather expose a dummy version of the real model objects, for user templates, with just the useful attributes populated on them. That way the same template constructs work in both user and server templates. I think we can do it without too much mess. Okay, first step is to write down what exactly is available to the templates. I have a patch for that on bug 966348. This patch sets up "fake" distro and distro_tree variables which have the same documented attributes, which means the custom Jinja filters like is_arch, is_osmajor will work the same way with them. http://gerrit.beaker-project.org/3946 Beaker 20.0 has been released. |