[et-mgmt-tools] Re: Cobbler, Cheetah and scripts in KS files

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

 



Hello,

I attached the error output I am getting as well when I totally
removed the above ( previous mail in thread ) section. So I am not
sure where the problem is.

Thanks,

Aaron

On 6/8/07, Aaron Lippold <lippold@xxxxxxxxx> wrote:
Hi All,

I am having issues with cobbler and importing a ks file of mine. All
is well with the simple parts of the %post section, but when I get to
a bit of scripting, the Cheetah parser complains at '" \/home "
${FSTAB} ' etc.

How can I escape this section or something?

Thanks,

Aaron

----- code below ----

# GEN002420

       FSTAB=/etc/fstab
       SED=/bin/sed
       # nosuid on /home
       if [ $(grep " \/home " ${FSTAB} | grep -c "nosuid") -eq 0 ]; then
               MNT_OPTS=$(grep " \/home " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/home.*${MNT_OPTS}\)/\1,nosuid/" ${FSTAB}
       fi

       # nosuid on /sys
       if [ $(grep " \/sys " ${FSTAB} | grep -c "nosuid") -eq 0 ]; then
               MNT_OPTS=$(grep " \/sys " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/sys.*${MNT_OPTS}\)/\1,nosuid/" ${FSTAB}
       fi

       # nosuid on /boot
       if [ $(grep " \/boot " ${FSTAB} | grep -c "nosuid") -eq 0 ]; then
               MNT_OPTS=$(grep " \/boot " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/boot.*${MNT_OPTS}\)/\1,nosuid/" ${FSTAB}
       fi

       # nodev on /usr
       if [ $(grep " \/usr " ${FSTAB} | grep -c "nodev") -eq 0 ]; then
               MNT_OPTS=$(grep " \/usr " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/usr.*${MNT_OPTS}\)/\1,nodev/" ${FSTAB}
       fi

       #nodev on /home
       if [ $(grep " \/home " ${FSTAB} | grep -c "nodev") -eq 0 ]; then
               MNT_OPTS=$(grep " \/home " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/home.*${MNT_OPTS}\)/\1,nodev/" ${FSTAB}
       fi

       # nodev on /usr
       if [ $(grep " \/usr " ${FSTAB} | grep -c "nodev") -eq 0 ]; then
               MNT_OPTS=$(grep " \/usr " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/usr.*${MNT_OPTS}\)/\1,nodev/" ${FSTAB}
       fi

       # nodev on /usr/local
       if [ $(grep " \/usr\/local " ${FSTAB} | grep -c "nodev") -eq 0 ]; then
               MNT_OPTS=$(grep " \/usr\/local " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/usr\/local.*${MNT_OPTS}\)/\1,nodev/" ${FSTAB}
       fi

       # nodev on /tmp
       if [ $(grep " \/tmp " ${FSTAB} | grep -c "nodev") -eq 0 ]; then
               MNT_OPTS=$(grep " \/tmp " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/tmp.*${MNT_OPTS}\)/\1,nodev/" ${FSTAB}
       fi

       # nodev on /var
       if [ $(grep " \/var " ${FSTAB} | grep -c "nodev") -eq 0 ]; then
               MNT_OPTS=$(grep " \/var " ${FSTAB} | awk '{print $4}')
               ${SED} -i "s/\( \/var.*${MNT_OPTS}\)/\1,nodev/" ${FSTAB}
       fi
# GEN003080

[root@localhost work]# cobbler profile add --distro=RHEL5.0-Desktop-i386 --name=x --kickstart=/work/rhel5-baseline-2.txt 
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cobbler/action_sync.py", line 279, in validate_kickstart_for_specific_profile
    self.apply_template(kfile, meta, dest)
  File "/usr/lib/python2.4/site-packages/cobbler/action_sync.py", line 406, in apply_template
    t = Template(source=data, searchList=[metadata])
  File "/usr/lib/python2.4/site-packages/Cheetah/Template.py", line 1200, in __init__
    self._compile(source, file, compilerSettings=compilerSettings)
  File "/usr/lib/python2.4/site-packages/Cheetah/Template.py", line 1488, in _compile
    keepRefToGeneratedCode=True)
  File "/usr/lib/python2.4/site-packages/Cheetah/Template.py", line 716, in compile
    compiler.compile()
  File "/usr/lib/python2.4/site-packages/Cheetah/Compiler.py", line 1643, in compile
    self._parser.parse()
  File "/usr/lib/python2.4/site-packages/Cheetah/Parser.py", line 1445, in parse
    self.assertEmptyOpenDirectivesStack()
  File "/usr/lib/python2.4/site-packages/Cheetah/Parser.py", line 2554, in assertEmptyOpenDirectivesStack
    raise ParseError(self, msg=errorMsg)
ParseError: 

Some #directives are missing their corresponding #end ___ tag: for, for
Line 755, column 65

Line|Cheetah Code
----|-------------------------------------------------------------
752 |find /var/log/ -type f -not -perm 644 -exec chmod 644 {} \;
753 |
754 |# GEN001280
755 |find /usr/share/man -type f -not -perm 644 -exec chmod 644 {} \;

[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