Skip to content

Commit b588efd

Browse files
committed
Add support for requiring a user with a home directory
1 parent c1801fb commit b588efd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fabtools/require/users.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
from fabtools.files import is_file
55
from fabtools.user import *
66

7+
import fabtools.require
78

8-
def user(name):
9+
10+
def user(name, home=None):
911
"""
1012
Require a user
1113
"""
1214
if not exists(name):
13-
create(name)
15+
create(name, home=home)
16+
if home:
17+
fabtools.require.directory(home, owner=name, use_sudo=True)
1418

1519

1620
def sudoer(username, hosts="ALL", operators="ALL", passwd=False, commands="ALL"):

0 commit comments

Comments
 (0)