Sha256: 2226b3ceb9e6ab9fc4bdaaae54fc373cb3f46593f062279207f4e1a80cc0e691

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 Bytes

Contents

require 'chef/knife'

class Chef
  class Knife
    class TagDelete < Knife

      deps do
        require 'chef/node'
      end

      banner "knife tag delete NODE TAG ..."

      def run
        name = @name_args[0]
        tags = @name_args[1..-1].join(",").split(/\s*,\s*/)

        unless name or tags.empty?
          show_usage
          # TODO: blah blah
          ui.fatal("You must specify a node name")
          exit 1
        end

        node = Chef::Node.load name
        tags.each do |tag|
          node.tags.delete tag
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
chef-0.10.0.beta.8 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.7 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.6 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.5 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.4 lib/chef/knife/tag_delete.rb
TrueCar-chef-0.10.0.beta.3 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.3 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.2 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.1 lib/chef/knife/tag_delete.rb
chef-0.10.0.beta.0 lib/chef/knife/tag_delete.rb