FlossWare / cobbler

Repository of Cobbler related functionality.
Other
3 stars 3 forks source link

Need template for simplifying OS naming #1

Closed sfloess closed 8 years ago

sfloess commented 10 years ago

Simplifying the computation of operating system name

and version...

if $getVar('$operatingSystem', '') == '' and $getVar('$os_version', '') != ''

#if $os_version.startswith('fedora')
    #set $operatingSystem = 'fedora'
#else if $os_version.startswith('rhel')
    #set $operatingSystem = 'rhel'
#end if

end if

if $getVar('$operatingSystemVersion', '') == ''

set $operatingSystemVersion = float($os_version.replace($operatingSystem, '0'))

end if

sfloess commented 8 years ago

Closing as we are using a better method of value/variable computation. As an example:

#set onDiskParam=$getVar('bootDisk', '') and ('--ondisk=' + $getVar('bootDisk')) or ''
part boot --fstype="$getVar('bootPartition', 'ext3')" --recommended --size=$getVar('bootPartitionSize', '250') $onDiskParam