I apologize again for the badly entitled mail and for *MY* 
misunderstanding of what "cobbler import --available-as" does.

The subject should have been, "cobbler import with the --available-as 
option chokes on disc1 of a multiple iso image install tree".  My point 
of view is that it should not because all the info is there.

> This is not a problem for DVDs.
>   
Our in-house mirror of the Red Hat iso images only provides DVD images 
from Rhel4.5 on, that is my particular constraint.

> I do not see the attached patch, but I am *NOT* extending import to deal 
> with multiple CD images.
>   
I am not asking you to extend cobbler import to deal with multiple CD 
images. If it could just play a little nicer with disc1 of a multiple CD 
iso set.

As I said yesterday the arch is determined from kernel* pkgs which 
happen to be on disc2 in my case.  I am in-lining the patch below.  
Hopefully, this time I have been a little clearer.  Many thanks again 
for cobbler and your time.

All the best,

Gareth

--- action_import.py.orig    2009-05-08 17:36:31.000000000 +0200
+++ action_import.py    2009-05-13 16:22:00.000000000 +0200
@@ -944,20 +944,36 @@
        for producing predictable distro names (and profile names) from 
differing import sources
        """
        result = {}
-       # FIXME : this is called only once, should not be a walk     
-       os.path.walk(self.get_pkgdir(), self.arch_walker, result)     
-       # print _("- architectures found at %s: %s") % ( 
self.get_pkgdir(), result.keys() )
+       # FIXME : this is called only once, should not be a walk
+       arch = self.get_arch()
+       result[arch] = 1
+       if not arch:
+           os.path.walk(self.get_pkgdir(), self.arch_walker, result)     
+       print _("- architectures found at %s: %s") % ( 
self.get_pkgdir(), result.keys() )
        if result.pop("amd64",False):
            result["x86_64"] = 1
        if result.pop("i686",False):
            result["i386"] = 1
        return result.keys()
 
+   def get_discinfo(self):
+       """
+       Allows each breed to return its discinfo file contents
+       """
+       return None
+
    def get_datestamp(self):
        """
        Allows each breed to return its datetime stamp
        """
        return None
+
+   def get_arch(self):
+       """
+       Allows each breed to return its arch
+       """
+       return None
+
    # ===================================================================
 
    def __init__(self,(rootdir,pkgdir)):
@@ -1051,18 +1067,30 @@
        minor = float(accum[1])
        return (flavor, major, minor)
 
-   def get_datestamp(self):
+   def get_discinfo(self):
        """
-       Based on a RedHat tree find the creation timestamp
+       Based on a RedHat tree find the associated .discinfo file(s)
        """
        base = self.get_rootdir()
        if os.path.exists("%s/.discinfo" % base):
-           discinfo = open("%s/.discinfo" % base, "r")
-           datestamp = discinfo.read().split("\n")[0]
-           discinfo.close()
+           discinfo_file = open("%s/.discinfo" % base, "r")
+           discinfo = discinfo_file.read().split("\n")
+           discinfo_file.close()
        else:
            return 0
-       return float(datestamp)
+       return discinfo
+
+   def get_datestamp(self):
+       """
+       Based on a RedHat tree find the creation timestamp
+       """
+       return float(self.get_discinfo()[0])
+
+   def get_arch(self):
+       """
+       Based on a RedHat tree find the primary arch
+       """
+       return str(self.get_discinfo()[2])
 
    def set_variance(self, flavor, major, minor, arch):
  

-- 


_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to