From 0a30663a1e590a0313680a5c9cbc410dae13ac8a Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 30 Mar 2015 22:11:17 -0400 Subject: [PATCH] minor fix to method of finding home as previous could 'overmatch' --- lib/ansible/modules/extras/cloud/lxc/lxc_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/cloud/lxc/lxc_container.py b/lib/ansible/modules/extras/cloud/lxc/lxc_container.py index c5b290827bf..5f0f6bb2ad6 100644 --- a/lib/ansible/modules/extras/cloud/lxc/lxc_container.py +++ b/lib/ansible/modules/extras/cloud/lxc/lxc_container.py @@ -398,7 +398,7 @@ LXC_ANSIBLE_STATES = { # home directory of the user that was attached to the container and source # that users environment variables by default. ATTACH_TEMPLATE = """#!/usr/bin/env bash -pushd "$(grep $(whoami) /etc/passwd | awk -F':' '{print $6}')" +pushd "$(getent passwd $(whoami)|cut -f6 -d':')" if [[ -f ".bashrc" ]];then source .bashrc fi