On 07/29/2009 09:48 AM, Simon Woolsgrove wrote:
--- mdehaan@redhat.com wrote:

From: Michael DeHaan <mdehaan@redhat.com>
To: simon@woolsgrove.com,        cobbler development list <cobbler-devel@lists.fedorahosted.org>
Subject: Re: [PATCH] Cobbler buildiso ksdevice support
Date: Mon, 27 Jul 2009 14:25:31 -0400

On 07/27/2009 01:01 PM, Simon Woolsgrove wrote:
  
Apologies if I have coded this real bad, still getting head around the cobbler, so let me know if there is a better way to do this.

This patch is to support adding the correct static ip entries when cobbler buildiso is used for systems, currently it just looks at eth0 even if ksdevice=vmnic?, eth? or  mac address other than eth0.  I have just done this against the 1.6 base, but can also do master if this is any good.

Cheers,
Simon


   
------------------------------------------------------------------------

_______________________________________________
cobbler-devel mailing list
cobbler-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler-devel
   
    

  
Patch needs to be applied against master.
    

  
Also, implementation wise, it would be better to do something like 
(caution:  pseudocode-ish typing my thoughts, may not 100% compile 
directly):
    

  
blended = utils.blender(api_handle, object_root, False)   # don't 
collapse to strings
ksdevice = blended.get("ksdevice")
if obj.interfaces.has_key(ksdevice):
    primary_interface = ksdevice
    


  
Right?   That seems to pick primary_interface a bit faster.
    

Thanks for the pointer here is patch against master using  the un-collapsed data.

Cheers,
Simon


  

Thanks! I'll apply this shortly!


One minor style suggestion for the future is:

+                       if data.has_key("ip_address_" + ksdevice ) and data["ip_address_" + ksdevice] != "":


Can be written:

if data.get("ip_address_" + ksdevice,"") != ""

   
Which saves a bit of code by avoiding the "has_key" check. 

--Michael











  

_______________________________________________ cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel