mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
refactor: force to use boolean
This commit is contained in:
parent
849d19edd7
commit
0ce4d7feb6
1 changed files with 8 additions and 4 deletions
|
@ -111,10 +111,14 @@ def add(name,
|
|||
except OSError:
|
||||
log.debug('Error reading /etc/login.defs', exc_info=True)
|
||||
|
||||
if createhome:
|
||||
cmd.append('-m')
|
||||
elif createhome is False:
|
||||
cmd.append('-M')
|
||||
if isinstance(createhome, bool):
|
||||
if createhome:
|
||||
cmd.append('-m')
|
||||
else:
|
||||
cmd.append('-M')
|
||||
else:
|
||||
log.error('Value passes to ``createhome`` must be a boolean')
|
||||
return False
|
||||
|
||||
if home is not None:
|
||||
cmd.extend(['-d', home])
|
||||
|
|
Loading…
Add table
Reference in a new issue