saltstack/salt — pull request #970 by nwjsmith (2012-03-20 13:37:06+00:00)
Title: Work around Python 2.6 bug involving relative paths from root

In Python 2.6, calling `os.path.relpath('/foo/bar', '/')` incorrectly returns a path `../foo/bar`. In Python 2.7 this is fixed, but this commit adds a workaround that works in both 2.6 and 2.7.

I had previously tried to fix this in #928, but I wasn't careful and didn't actually fix the problem. This time I wrote some tests around my fix (see https://gist.github.com/2126960), showing that it works.

I'd like to add the tests as well if possible, but I'm not sure where/how to work them in.