#NEWLINE# def chgid( name , gid , root = None ) : #NEWLINE# #INDENT# "\n    Change the gid for a named group\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' group.chgid foo 4376\n    " #NEWLINE# pre_gid = __salt__ [ 'file.group_to_gid' ] ( name ) #NEWLINE# if ( gid == pre_gid ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# cmd = ( 'groupmod' , '-g' , gid , name ) #NEWLINE# if ( root is not None ) : #NEWLINE# #INDENT# cmd . extend ( ( '-R' , root ) ) #NEWLINE# #UNINDENT# __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) #NEWLINE# post_gid = __salt__ [ 'file.group_to_gid' ] ( name ) #NEWLINE# if ( post_gid != pre_gid ) : #NEWLINE# #INDENT# return ( post_gid == cmd ) #NEWLINE# #UNINDENT# return False