#NEWLINE# def system( name ) : #NEWLINE# #INDENT# '\n    Set the keyboard layout for the system\n\n    name\n        The keyboard layout to use\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'result' : None , #NEWLINE# 'comment' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# if ( __salt__ [ 'keyboard.get_sys' ] ( ) == name ) : #NEWLINE# #INDENT# ret [ 'result' ] = True #NEWLINE# ret [ 'comment' ] = 'System layout {0} already set' . format ( name ) #NEWLINE# return ret #NEWLINE# #UNINDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'System layout {0} needs to be set' . format ( name ) #NEWLINE# return ret #NEWLINE# #UNINDENT# if __salt__ [ 'keyboard.set_sys' ] ( name ) : #NEWLINE# #INDENT# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'layout' : name , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'result' ] = True #NEWLINE# ret [ 'comment' ] = 'Set system keyboard layout {0}' . format ( name ) #NEWLINE# return ret #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Failed to set system keyboard layout' #NEWLINE# return ret