summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2008-11-27 11:21:47 -0500
committerTodd Zullinger <tmz@pobox.com>2008-11-27 21:33:20 -0500
commit1c025e053689188592d9df10865bf55577ebbe8d (patch)
tree31266bd812e1c620b7066a78303a421a63bdbe29
parentcf3bf1ce8951455c50de7b1f22aa17e693cc0785 (diff)
downloadpuppet-host-package-1c025e053689188592d9df10865bf55577ebbe8d.tar.gz
puppet-host-package-1c025e053689188592d9df10865bf55577ebbe8d.tar.xz
puppet-host-package-1c025e053689188592d9df10865bf55577ebbe8d.zip
Expand ~ and ~user in paths
-rwxr-xr-xpuppethost.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/puppethost.py b/puppethost.py
index eae1e8e..3f6671d 100755
--- a/puppethost.py
+++ b/puppethost.py
@@ -278,16 +278,18 @@ def _main():
if not args:
raise SystemExit(parser.print_usage())
- opts.rpmdir = os.path.abspath(opts.rpmdir)
- opts.ssldir = os.path.abspath(opts.ssldir)
+ opts.rpmdir = os.path.expanduser(os.path.abspath(opts.rpmdir))
+ opts.ssldir = os.path.expanduser(os.path.abspath(opts.ssldir))
for d in [opts.rpmdir, opts.ssldir]:
if not os.path.isdir(d):
raise SystemExit('%s does not exist (or is not a directory)' % d)
if not opts.destssldir:
opts.destssldir = opts.ssldir
+ else:
+ opts.destssldir = os.path.expanduser(os.path.abspath(opts.destssldir))
- opts.template = opts.template % opts.__dict__
+ opts.template = os.path.expanduser(opts.template % opts.__dict__)
if not os.path.isfile(opts.template):
raise SystemExit('Template file (%s) does not exist' % opts.template)