def _CreateYumSettings(args, messages):
  """Creates a YumSettings message from input arguments."""
  if not any([
      args.yum_excludes, args.yum_minimal, args.yum_security,
      args.yum_exclusive_packages
  ]):
    return None

  return messages.YumSettings(
      excludes=args.yum_excludes if args.yum_excludes else [],
      minimal=args.yum_minimal,
      security=args.yum_security,
      exclusivePackages=args.yum_exclusive_packages
      if args.yum_exclusive_packages else [],
  )