From 4a29e5eec5542a47e79aad419a449634e61a982b Mon Sep 17 00:00:00 2001 From: Manoj Srivastava Date: Mon, 8 Feb 2016 02:50:55 -0800 Subject: [PATCH] Bit by os.path.join not liking leading / join ignores all path components to the left of any component that starts with a /. Tested and found working. Signed-off-by: Manoj Srivastava --- bootstrapvz/plugins/admin_user/tasks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrapvz/plugins/admin_user/tasks.py b/bootstrapvz/plugins/admin_user/tasks.py index bf8df54..4293ee9 100644 --- a/bootstrapvz/plugins/admin_user/tasks.py +++ b/bootstrapvz/plugins/admin_user/tasks.py @@ -89,11 +89,11 @@ class AdminUserCredentialsPublicKey(Task): username = info.manifest.plugins['admin_user']['username'] - ssh_file = os.path.join('/home/', username, '.ssh/authorized_keys') - rel_ssh_file = os.path.join(info.root, ssh_file) + ssh_file = os.path.join('/home', username, '.ssh/authorized_keys') + rel_ssh_file = os.path.join(info.root, 'home', username, '.ssh/authorized_keys') ssh_dir = os.path.dirname(ssh_file) - rel_ssh_dir = os.path.join(info.root, ssh_dir) + rel_ssh_dir = os.path.dirname(rel_ssh_file) if not os.path.exists(rel_ssh_dir): log.debug('Creating %s.' % rel_ssh_dir) os.mkdir(rel_ssh_dir)