diff --git a/tools/apply-test.sh b/tools/apply-test.sh index d0d83843a6..4d41a7e672 100755 --- a/tools/apply-test.sh +++ b/tools/apply-test.sh @@ -59,10 +59,17 @@ if [[ ! -d applytest ]] ; then mkdir applytest fi -csplit -sf applytest/puppetapplytest manifests/site.pp '/^$/' {*} -sed -i -e 's/^[^][:space:]$]/#&/g' applytest/puppetapplytest* -sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' applytest/puppetapplytest* -mv applytest/*00 applytest/head # These are the top-level variables defined in site.pp +# First split the variables at the beginning of the file +csplit -sf applytest/prep manifests/site.pp '/^$/' {0} +# Then split the class defs. +csplit -sf applytest/puppetapplytest applytest/prep01 '/^}$/' {*} +# Remove } header left by csplit +sed -i -e '/^\}$/d' applytest/puppetapplytest* +# Comment out anything that doesn't begin with a space. +# This gives us the node {} internal contents. +sed -i -e 's/^[^][:space:]$]/#&/g' applytest/prep00 applytest/puppetapplytest* +sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' applytest/prep00 applytest/puppetapplytest* +mv applytest/prep00 applytest/head # These are the top-level variables defined in site.pp if [[ `lsb_release -i -s` == 'CentOS' ]]; then if [[ `lsb_release -r -s` =~ '6' ]]; then