From 39bc969e2224a74645dbfff4603ef735c29c08cf Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Sun, 17 Oct 2010 16:31:13 +0200 Subject: [PATCH] [attributs] test de shells valides ? --- attributs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attributs.py b/attributs.py index 746e5e9..6918b81 100644 --- a/attributs.py +++ b/attributs.py @@ -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