Support sample descriptions

This commit is contained in:
dave 2017-05-28 16:52:43 -07:00
parent 07e99017b1
commit 29a18f5135
4 changed files with 18 additions and 7 deletions

View File

@ -45,6 +45,13 @@
</div>
</div>
<br />
{% if SAMPLE_INFO %}
<div class="alert alert-warning" role="alert">
<h4 class="alert-heading">Template information</h4>
<p style="white-space: pre;">{{ SAMPLE_INFO }}</p>
</div>
<br />
{% endif %}
<fieldset class="form-group">
<legend>Menu Entries</legend>
<p>Selectable options displayed on the boot menu.</p>

16
main.py
View File

@ -24,11 +24,15 @@ class ISOserver(object):
for item in samples:
self.samples[item] = {}
with open(os.path.join("samples", item, "menu.default")) as f:
self.samples[item]["menu"] = f.read()
self.samples[item]["MENU_ENTRIES"] = f.read()
with open(os.path.join("samples", item, "seed.default")) as f:
self.samples[item]["seed"] = f.read()
self.samples[item]["SEED_CONTENT"] = f.read()
with open(os.path.join("samples", item, "ks.default")) as f:
self.samples[item]["ks"] = f.read()
self.samples[item]["KS_CONTENT"] = f.read()
info_path = os.path.join("samples", item, "info.txt")
if os.path.exists(info_path):
with open(os.path.join("samples", item, "info.txt")) as f:
self.samples[item]["SAMPLE_INFO"] = f.read()
@cherrypy.expose
def index(self, refresh=False, sample="default"):
@ -37,10 +41,8 @@ class ISOserver(object):
yield(self.template.render(ISOS=self.iso_selection,
SAMPLES=self.samples.keys(),
MENU_ENTRIES=self.samples[sample]["menu"],
SEED_CONTENT=self.samples[sample]["seed"],
KS_CONTENT=self.samples[sample]["ks"],
current_sample=sample))
current_sample=sample,
**self.samples[sample]))
@cherrypy.expose
def process(self, menu_entries, seed_content, kickstart, base_image, action, sample):

1
samples/default/info.txt Normal file
View File

@ -0,0 +1 @@
A basic automatic install intended for virtual machines. System updates will be installed on the first boot.

1
samples/lvm/info.txt Normal file
View File

@ -0,0 +1 @@
Identical to the default install, but with LVM for the root filesystem and a separate /boot partition.