[elbe-devel] [PATCH 2/4] setrepo: set noauth for project and initvm

Manuel Traut manut at linutronix.de
Mon Jul 23 15:49:55 CEST 2018


Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/elbexml.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index b19eef87..0d5fc204 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -117,7 +117,8 @@ class ElbeXML(object):
 
         return mirror.replace("LOCALMACHINE", "10.0.2.2")
 
-    def _set_repo(self, m, mirror, path, proto='http'):
+    def _set_repo(self, project, mirror, path, proto='http', auth=False):
+        m = project.node("mirror")
         m.clear() # this also clears url-list
         h = m.ensure_child("primary_host")
         h.set_text(mirror)
@@ -125,16 +126,15 @@ class ElbeXML(object):
         p.set_text(path)
         x = m.ensure_child("primary_proto")
         x.set_text(proto)
+        project.ensure_child("noauth")
 
     def set_repo(self, mirror, inintvmpath, targetpath, proto='http', auth=False):
-        i = self.node("initvm/mirror")
+        i = self.node("initvm")
         if i:
-            self._set_repo(i, mirror, inintvmpath, proto)
-        t = self.prj.node("mirror")
+            self._set_repo(i, mirror, inintvmpath, proto, auth)
+        t = self.prj
         if t:
-            self._set_repo(t, mirror, targetpath, proto)
-        if not auth:
-            self.prj.ensure_child("noauth")
+            self._set_repo(t, mirror, targetpath, proto, auth)
 
     # XXX: maybe add cdrom path param ?
     def create_apt_sources_list(self, build_sources=False):
-- 
2.18.0




More information about the elbe-devel mailing list