title: puppet define two variables in require, but one variable not work
body: <p>I defined some variables in my defined type <code>remote_file</code>.</p>
  <p>When I instantiate this type in <code>class cdnlog::base</code>, if I commented the line with <code>require_dir</code>, I get some error message in puppet client:</p>
  <blockquote>
  <p>Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: File[cdnlog-release] { require =&gt; , }, because , doesn't seem to be in the correct format. Resource references should be formatted as: Classname['title'] or Modulename::Classname['title'] (take careful note of the capitalization).</p>
  <p>Warning: Not using cache on failed catalog</p>
  <p>Error: Could not retrieve catalog; skipping run</p>
  </blockquote>
  <p>My manifest:</p>
  <pre><code>define remote_file($remote_location=undef, $path=undef, $mode='0644', $require_dir=undef){
    exec{&quot;retrieve_${title}&quot;:
      command =&gt; &quot;/usr/bin/wget -q ${remote_location} -O ${path}&quot;,
      creates =&gt; $path,
    }
    $require_exec=&quot;Exec[retrieve_${title}]&quot;
    if $require_dir {
      $require_file=&quot;File[$require_dir]&quot;
    }
    elsif $require_dir == undef {
      $require_file=&quot;,&quot;
    }
    file{$title:
      path    =&gt; $path,
      mode    =&gt; $mode,
      require =&gt; [$require_exec, $require_file],
    }
  }
  class cdnlog::base{
    tag 'cdnlog'
  
    file {'/etc':
      ensure       =&gt; directory,
      recurse      =&gt; true,
    }
    file {'/etc/rc.d/init.d':
      ensure       =&gt; directory,
      recurse      =&gt; true,
    }
    file {'/etc/cdnlog.d':
      ensure       =&gt; directory,
      recurse      =&gt; true,
    }
  
  ###########################################
  ###########################################
  ###########################################
    remote_file {'cdnlog-release':
      path                  =&gt; '/etc/cdnlog.d/cdnlog-release',
      remote_location       =&gt; &quot;${collectd_server}/tarball/cdnlog-release&quot;,
      require_dir           =&gt; '/etc/cdnlog.d',
    }
    remote_file {'cdnlog.conf':
      path                 =&gt; '/etc/cdnlog.conf',
      remote_location      =&gt; &quot;${collectd_server}/tarball/cdnlog.conf&quot;,
      require_dir           =&gt; '/etc',
  
    }
  }
  </code></pre>
  <p>thanks for your help</p>