Cobbler GIT: patch for autodetection of arch during import

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Hi all
	Attached is a patch for your reviewing pleasure that checks for
arch in "--mirror" url so if you don't set it using --arch, it tries to
autodetect it.

	Regards
	Pablo



-- 
Pablo Iranzo Gómez
(http://Alufis35.uv.es/~iranzo/)
(PGPKey Available on http://www.uv.es/~iranzop/PGPKey.pgp)
                  --
Postulado de Boling sobre la Ley de Murphy:

Si se encuentra bien, no se preocupe. Se le pasará
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 377b122..92ae6d7 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -70,8 +70,13 @@ class Importer:
            raise CX(_("import failed.  no --name specified"))
        if self.arch is not None:
            self.arch = self.arch.lower()
-           if self.arch not in [ "x86", "ia64", "x86_64" ]:
-               raise CX(_("arch must be x86, x86_64, or ia64"))
+       else:
+         if self.arch not in [ "i386", "x86", "ia64", "x86_64" ]:
+               for x in [ "i386", "x86", "ia64", "x86_64" ]:
+                 if self.mirror.lower().find(x) != -1:
+                   self.arch = x
+       if self.arch not in [ "i386", "x86", "ia64", "x86_64" ]:
+         raise CX(_("arch must be i386, x86, x86_64, or ia64"))

        mpath = os.path.join(self.settings.webdir, "ks_mirror", self.mirror_name)
        if os.path.exists(mpath) and self.arch is None:
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux