saltstack/salt — pull request #928 by nwjsmith (2012-03-16 19:57:22+00:00)
Title: Fix directory creation errors when using the file state

This fixes a bug in which Salt attempts to create a directory of the form `/var/cache/salt/extrn_files/example.com/..` when running a Salt state of the form:

```yml
/tmp/foo:
file:
- managed
- source: http://example.com/foo
- source_hash: md5=baa20a10c24bb1a385694ce88f930e9f
```

Since the path ends in `..`, the a `makedirs` call fails (since it tries to create a directory that already exists).

The problem is caused by the relpath call in some of the caching logic.

I'm not convinced this is the *best* way to fix it, but it does the job.