[attributs] test de shells valides ?
This commit is contained in:
parent
049f1b5460
commit
39bc969e22
1 changed files with 2 additions and 2 deletions
|
@ -453,8 +453,8 @@ class loginShell(Attr):
|
|||
|
||||
def parse_value(self, shell, ldif):
|
||||
with open('/etc/shells') as f:
|
||||
shells = f.readlines()
|
||||
if (shell not in shells) or shell.startswith('#'):
|
||||
shells = [ l.strip() for l in f.readlines() if not l.startswith('#') ]
|
||||
if (shell not in shells)
|
||||
raise ValueError("Shell %s invalide" % shell)
|
||||
self.value = shell
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue