ployground / ploy

A tool to manage servers through a central configuration. Plugins allow provisioning, configuration and other management tasks.
http://ploy.readthedocs.org
BSD 3-Clause "New" or "Revised" License
78 stars 15 forks source link

Fix for $HOME expansion on Mac OS X #20

Closed cloudartisan closed 10 years ago

cloudartisan commented 13 years ago

os.path.expanduser does not seem to expand $HOME on Mac (only variations on ~), but os.path.expandvar does successfully expand $HOME (and any other variables in the path)

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin 
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['HOME']
'/Users/david'
>>> os.path.expanduser('$HOME')
'$HOME'
>>> os.path.expanduser('$HOME/')
'$HOME/'
>>> os.path.expanduser('~')
'/Users/david'
>>> os.path.expanduser('~david')
'/Users/david'
>>> os.path.expandvars('$HOME')
'/Users/david'
fschulze commented 13 years ago

It makes sense to expand vars, but your commit has a typo "expendvars" for the "key_file" line.

cloudartisan commented 13 years ago

Ah, sorry about that, I'll fix it.