title: Correct syntax for if statement in saltstack
body: <p>Running following command:
  <code>salt host1 file.check_perms /xxx/zzz '{}' root sudo 0750</code>
  I will get True,
  I like add this to my state, but can't find the correct syntax.</p>
  
  <pre><code>{% if not salt['file.check_perms']('/xxx/zzz/', '{}',['root'],['sudo'],['0750']) %
  Set group ownership and permissions:
    file.directory:
      - name: /xxx/zzz/
      - user: root
      - group: sudo
      - dir_mode: 750
      - file_mode: 750
      - recurse:
        - user
        - group
        - mode
  {% endif %}
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code> Data failed to compile:
  ----------
      Rendering SLS 'base:certbot.cert' failed: Jinja error: string indices must be integers, not unicode
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 392, in render_jinja_tmpl
      output = template.render(**decoded_context)
    File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render
      return self.environment.handle_exception(exc_info, True)
    File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "&lt;template&gt;", line 13, in top-level template code
    File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 4469, in check_perms
      orig_comment = ret['comment']
  TypeError: string indices must be integers, not unicode
  </code></pre>
  
  <p>Could anyone help me?</p>