[attributs] Liste des shell dans gestion.config

This commit is contained in:
Valentin Samir 2014-03-21 09:13:50 +01:00
parent ed3b43073c
commit f8036659a6

View file

@ -1262,31 +1262,9 @@ class loginShell(Attr):
def parse_value(self, shell):
#with open('/etc/shells') as f:
# shells = [ l.strip() for l in f.readlines() if not l.startswith('#') ]
shells = [u'/bin/csh',
u'/bin/sh',
u'/usr/bin/es',
u'/usr/bin/ksh',
u'/bin/ksh',
u'/usr/bin/rc',
u'/usr/bin/tcsh',
u'/bin/tcsh',
u'/usr/bin/esh',
u'/bin/bash',
u'/bin/rbash',
u'/bin/zsh',
u'/usr/bin/zsh',
u'/usr/bin/screen',
u'/bin/dash',
u'/usr/bin/rssh',
u'/usr/local/bin/disconnect_shell',
u'/usr/scripts/surveillance/disconnect_shell',
u'/usr/local/bin/badPassSh',
u'/usr/bin/passwd',
u'/bin/false',
u'/usr/sbin/nologin'
u'']
shells = config.shells_possibles
if shell not in shells:
raise ValueError("Shell %r invalide" % shell)
raise ValueError("Shell %r invalide.\nLes shells valident sont : %s" % (shell, ', '.join(shells)))
self.value = shell
@crans_attribute