code: def _update_gecos(name, key, value, root=None):
      '''
      Common code to change a user's GECOS information
      '''
      if value is None:
          value = ''
      elif not isinstance(value, six.string_types):
          value = six.text_type(value)
      else:
          value = salt.utils.stringutils.to_unicode(value)
      pre_info = _get_gecos(name, root=root)
      if not pre_info:
          return False
      if value == pre_info[key]:
          return True
      gecos_data = copy.deepcopy(pre_info)
      gecos_data[key] = value
  
      cmd = ['usermod']
      if root is not None and __grains__['kernel'] != 'AIX':
          cmd.extend(('-R', root))
      cmd.extend(('-c', _build_gecos(gecos_data), name))
  
      __salt__['cmd.run'](cmd, python_shell=False)
      return _get_gecos(name, root=root).get(key) == valuf _update_gecos(name, key, value, root=None):
      '''
      Common code to change a user's GECOS information
      '''
      if value is None:
          value = ''
      elif not isinstance(value, six.string_types):
          value = six.text_type(value)
      else:
          value = salt.utils.stringutils.to_unicode(value)
      pre_info = _get_gecos(name, root=root)
      if not pre_info:
          return False
      if value == pre_info[key]:
          return True
      gecos_data = copy.deepcopy(pre_info)
      gecos_data[key] = value
  
      cmd = ['usermod']
      if root is not None and __grains__['kernel'] != 'AIX':
          cmd.extend(('-R', root))
      cmd.extend(('-c', _build_gecos(gecos_data), name))
  
      __salt__['cmd.run'](cmd, python_shell=False)
      return _get_gecos(name, root=root).get(key) == value
docs: Common code to change a user's GECOS information