#NEWLINE# def chshell( name , shell ) : #NEWLINE# #INDENT# "\n    Change the default shell of the user\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' user.chshell foo /bin/zsh\n    " #NEWLINE# pre_info = info ( name ) #NEWLINE# if ( not pre_info ) : #NEWLINE# #INDENT# raise CommandExecutionError ( "User '{0}' does not exist" . format ( name ) ) #NEWLINE# #UNINDENT# if ( shell == pre_info [ 'shell' ] ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# cmd = [ 'usermod' , '-s' , shell , name ] #NEWLINE# __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) #NEWLINE# return ( info ( name ) . get ( 'shell' ) == shell )