<commit_before>require 'puppet/face/node_aws'
require 'puppet/cloudpack'

Puppet::Face.define :node_aws, '0.0.1' do
  action :list do

    summary 'List AWS EC2 node instances'

    arguments 'NONE'

    description <<-'EOT'
      The list action obtains a list of instances from the cloud provider and
      displays them on the console output.  For EC2 instances, only the instances in
      a specific region are provided.
    EOT

    Puppet::CloudPack.add_list_options(self)

    when_invoked do |options|
      Puppet::CloudPack.list(options)
    end

    when_rendering :console do |value|
      value.collect do |id,status_hash|
        "#{id}:\n" + status_hash.collect do |field, val|
          "  #{field}: #{val}"
        end.sort.join("\n")
      end.sort.join("\n")
    end

    returns 'Array of attribute hashes containing information about each EC2 instance.'

    examples <<-'EOT'
      $ puppet node_ec5 list
    EOT

  end

end

<commit_msg>(#9442) Fixup puppet node_aws list example output<commit_after>require 'puppet/face/node_aws'
require 'puppet/cloudpack'

Puppet::Face.define :node_aws, '0.0.1' do
  action :list do

    summary 'List AWS EC2 node instances'

    arguments 'NONE'

    description <<-'EOT'
      The list action obtains a list of instances from the cloud provider and
      displays them on the console output.  For EC2 instances, only the instances in
      a specific region are provided.
    EOT

    Puppet::CloudPack.add_list_options(self)

    when_invoked do |options|
      Puppet::CloudPack.list(options)
    end

    when_rendering :console do |value|
      value.collect do |id,status_hash|
        "#{id}:\n" + status_hash.collect do |field, val|
          "  #{field}: #{val}"
        end.sort.join("\n")
      end.sort.join("\n")
    end

    returns 'Array of attribute hashes containing information about each EC2 instance.'

    examples <<-'EOT'
      $ puppet node_aws list
      i-e8e04588:
        created_at: Tue Sep 13 01:21:16 UTC 2011
        dns_name: ec2-184-72-85-208.compute-1.amazonaws.com
        id: i-e8e04588
        state: running
    EOT

  end

end


{'fraction_non_alphanumeric': 0.0985452839042703, 'fraction_numerical': 0.024870952604411075, 'mean_word_length': 2.6949740034662044, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2741168', 'n_tokens_mistral': 725, 'n_tokens_neox': 678, 'n_words': 210}