Hi,

I want to figure out (or rather: pass them to cobbler via ksmeta variables):

I have:

disk=cciss/c0d0,cciss/c0d1

in the ksmeta-string.

I've got a snippet, that is included in the template via
$SNIPPET('disk_double_big_opt_neutral')

It looks like this:

#set $disks=getVar('$disk', None)
#set $disk1=$disks.split(',')[0]
#set $disk2=$disks.split(',')[1]

clearpart --all --drives=$disks
part /boot --fstype ext3 --size=100 --ondisk=$disk1
part pv.2 --size=0 --grow --ondisk=$disk1
volgroup VolGroup00 --pesize=32768 pv.2
logvol swap --fstype swap --name=swapvol --vgname=VolGroup00 --size=512
--grow --maxsize=$ksmaxswap
logvol / --fstype ext3 --name=rootvol --vgname=VolGroup00
--size=$ksmaxslash --grow
logvol /tmp --fstype ext3 --name=tmpvol --vgname=VolGroup00 --size=$ksmaxtmp
part pv.3 --size=0 --grow --ondisk=$disk2
volgroup VolGroup01 --pesize=32768 pv.3
logvol $bigpart --fstype ext3 --name=bigvol --vgname=VolGroup01
--size=$ksmaxbig --grow


But all I get is a big error when I want to view the rendered result:

# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly. 
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.  
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
# 
# global name 'getVar' is not defined
#   File "/usr/lib/python2.4/site-packages/cobbler/templar.py", line 114, in 
render
#     data_out = str(t)
# 
#   File "/usr/lib/python2.4/site-packages/Cheetah/Template.py", line 994, in 
__str__
#     def __str__(self): return getattr(self, mainMethName)()
# 
#   File "cheetah_DynamicallyCompiledCheetahTemplate_1233079651_86_79472.py", 
line 290, in respond
# 
#   File "cheetah_DynamicallyCompiledCheetahTemplate_1233079651_86_79472.py", 
line 127, in __errorCatcher9
# 
#   File "<string>", line 0, in ?
# 
#   File "/usr/lib/python2.4/site-packages/cobbler/template_api.py", line 156, 
in SNIPPET
#     result = BuiltinTemplate.SNIPPET(self, file)
# 
#   File "DynamicallyCompiledCheetahTemplate.py", line 89, in SNIPPET
# 
#   File "/usr/lib/python2.4/site-packages/Cheetah/Template.py", line 1536, in 
_handleCheetahInclude
#     self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
# 
#   File 
"cheetah__var_lib_cobbler_snippets_disk_double_big_opt_neutral_1233079619_04_60080.py",
 line 148, in respond
# 

<pre>
Mod_python error: "PythonHandler services"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in 
HandlerDispatch
    result = object(req)

  File "/var/www/cobbler/svc/services.py", line 98, in handler
    return apache.HTTP_ERROR

AttributeError: 'module' object has no attribute 'HTTP_ERROR'

</pre>


It does work when I remove the "set" directives (but then, it doesn't
replace anything).

How do I have to put it so that the replacement works correctly?
It seems the first line is already making it bomb-out - but I took that
from the example in the wiki.




Regards,
Rainer

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

Reply via email to