Attached is a snippet that makes use of cheetah methods. These are similar to 
some of the functionality that the Solaris SST offers. They basically 
encapsulate many (usually obscure) sed commands into handy functions.

$set_config_value('/etc/login.defs', 'LOGIN_RETRIES', 3)

is more readable than:

perl -npe 's/^([ \t]*$LOGIN_RETRIES[ \t]+)[\x21-\x7E]*([ 
\t]*(#.*)?)$/\${1}3\${2}/' -i '/etc/login.defs'

and the perl (sed) command doesn't take into account the possibility that 
LOGIN_RETRIES may not already be present in the file. The use of a function 
makes kickstart templates more readable and helps avoid errors.

Because of the utility of these functions, I would suggest they be distributed 
with cobbler, possibly as 'built-in' methods.

Development note: although I have tested that these functions do not cause any 
Cheetah errors, I have not tested the resulting kickstarts in an actual 
provision. They may still cause errors on the client side :( .

~
Dan

_________________________________________________________________
With Windows Live for mobile, your contacts travel with you.
http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008

Attachment: util
Description: Binary data

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

Reply via email to