Sha256: 732afc989a15401932bebe35472065a5a78e777388f2d45fe86cd8e40eb0212a

Contents?: true

Size: 758 Bytes

Versions: 11

Compression:

Stored size: 758 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentTagList < Knife

      include Knife::JoyentBase

      banner "knife joyent tag list <server>"

      def run
        server = name_args.first

        unless server
          show_usage
          exit 1
        end

        tags = [
          ui.color('Name', :bold),
          ui.color('Value', :bold),
        ]

        self.connection.servers.get(server).tags.each do |k, v|
          tags << k
          tags << v
        end

        puts ui.list(tags, :uneven_columns_across, 2)
        exit 0
      rescue Excon::Errors::NotFound => e
        puts ui.error("Server #{server} not found")
        exit 1

      rescue => e
        output_error(e)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
knife-joyent-0.4.14 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.12 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.11 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.10 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.9 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.8 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.5 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.4 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.3 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.2 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.4.1 lib/chef/knife/joyent_tag_list.rb