anchor.diff:  success="false"
   for tries in 1 2 3; do
     yumdownloader --releasever=<%= releasever %> --disablerepo='nailgun*' --disablerepo='fuel*' --setopt='*.skip_if_unavailable=1' --resolve --destdir /root/rhnpackages $rhnpackages
  -  if [ $? -eq 0 ]; then
  -    #Verify we have packages downloaded
  -    if [[ "$(find /root/rhnpackages | wc -l)" > 2 ]]; then
  -      success="true"
  -      break
  -    fi
  +  #Verify we have packages downloaded
  +  if [[ "$(find /root/rhnpackages | wc -l)" > 2 ]]; then
  +    success="true"
  +    break
     fi
     yum clean expire-cache
   done
  
positive.code: subscription-manager unregister
  rm -rf /etc/yum.repos.d/redhat.repo
  
  #Run registration
  
  rhnreg_ks "--serverUrl=http://<%= sat_hostname %>/XMLRPC" --profilename=fuelweb "--activationkey=<%= activation_key %>" --sslCACert=/etc/sysconfig/rhn/RHNS-CA-CERT --nopackages --nohardware --novirtinfo --norhnsd --force
  
  if [ $? -ne 0 ]; then
    echo "Registration failed. Aborting."
    exit 1
  fi
  #Ensure channels are enabled:
  
negative.code: done
  if [ $errors -gt 0 ]; then
    echo "There were problems enabling channels. Please check puppet manifests and your RHN Satellite channel configuration to ensure the necessary channels are enabled." 1>&2
    revert_back_to_centos
    exit 1
  fi
  
  