[elbe-devel] [PATCH] preseed.cfg: allow url-list urls with no binary

Manuel Traut manut at linutronix.de
Mon Jul 23 15:33:25 CEST 2018


schema allows

<url-list>
  <url>
    <source>http://...</source>
  </url>
</url-list>

however this ends in an error during preseed.cfg generation:

line 899, in _exec_template
13:14:57     callable_(context, *args, **kwargs)
13:14:57   File "/home/elbe/elbepack/init/preseed.cfg.mako", line 83, in render_body
13:14:57     <% tmp = n.text("binary").replace("LOCALMACHINE", "10.0.2.2") %>
13:14:57   File "/home/elbe/elbepack/treeutils.py", line 44, in text
13:14:57     raise Exception("Cant find path %s" % path)
13:14:57 Exception: Cant find path binary
13:14:57
13:14:57     init_template_dir, t), d, linebreak=False)
13:14:57   File "/home/elbe/elbepack/templates.py", line 38, in write_template
13:14:57     outfile.write(template(fname, d, linebreak))
13:14:57   File "/home/elbe/elbepack/templates.py", line 30, in template
13:14:57     return Template(filename=fname).render(**d)
13:14:57   File "/usr/lib/python2.7/dist-packages/mako/template.py", line 462, in render
13:14:57     return runtime._render(self, self.callable_, args, data)
13:14:57   File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 838, in _render
13:14:57     **_kwargs_for_callable(callable_, data))
13:14:57   File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 873, in _render_context
13:14:57     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
13:14:57   File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 899, in _exec_template
13:14:57     callable_(context, *args, **kwargs)
13:14:57   File "_home_elbe_elbepack_init_preseed_cfg_mako", line 69, in render_body
13:14:57   File "/home/elbe/elbepack/treeutils.py", line 44, in text
13:14:57     raise Exception("Cant find path %s" % path)
13:14:57 Exception: Cant find path binary

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/init/preseed.cfg.mako | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elbepack/init/preseed.cfg.mako b/elbepack/init/preseed.cfg.mako
index 333f65c2..052be882 100644
--- a/elbepack/init/preseed.cfg.mako
+++ b/elbepack/init/preseed.cfg.mako
@@ -80,6 +80,7 @@ d-i mirror/protocol string ${prj.text("mirror/primary_proto")}
 <% i=0 %>
 % if prj.node("mirror/url-list"):
 % for n in prj.node("mirror/url-list"):
+% if n.has("binary"):
 <% tmp = n.text("binary").replace("LOCALMACHINE", "10.0.2.2") %>
 d-i apt-setup/local${i}/repository string ${tmp.strip()}
 d-i apt-setup/local${i}/comment string local server
@@ -87,6 +88,7 @@ d-i apt-setup/local${i}/source boolean true
 % if n.has("key"):
 d-i apt-setup/local${i}/key string ${n.text("key").replace("LOCALMACHINE", "10.0.2.2").strip()}
 % endif
+% endif
 <% i+=1 %>
 % endfor
 % endif
-- 
2.18.0




More information about the elbe-devel mailing list