Class: KnifePlayground::PgClientnodeDelete

Inherits:
Chef::Knife
  • Object
show all
Defined in:
lib/chef/knife/pg.rb

Defined Under Namespace

Classes: PgGitCookbookUpload

Instance Method Summary collapse

Instance Method Details

#runObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/chef/knife/pg.rb', line 32

def run
  @client_name = @name_args[0]
  if @client_name.nil?
    show_usage
    ui.fatal("You must specify a client name")
    exit 1
  end
  ui.info "Deleting CLIENT #{@client_name}..."
  delete_object(Chef::ApiClient, @client_name)

  @node_name = @name_args[0]
  if @node_name.nil?
    show_usage
    ui.fatal("You must specify a node name")
    exit 1
  end
  ui.info "Deleting NODE #{@node_name}..."
  delete_object(Chef::Node, @node_name)

end