Class: Chef::Knife::RhnSystemDelete

Inherits:
Chef::Knife show all
Includes:
RhnBase
Defined in:
lib/chef/knife/rhn_system_delete.rb

Defined Under Namespace

Modules: System

Instance Method Summary collapse

Methods included from RhnBase

#get_config, #get_satellite_system, included, #set_rhn_connection_options

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/chef/knife/rhn_system_delete.rb', line 24

def run
  $stdout.sync = true
  
  system = name_args.first

  if system.nil?
    ui.fatal "You need a system name!"
    show_usage
    exit 1
  end

  set_rhn_connection_options

  satellite_system = get_satellite_system(system)

  RhnSatellite::System.extend(System)
  RhnSatellite::System.delete(satellite_system['id'])
  ui.info "Deleted RHN System: #{satellite_system['name']} (ID: #{satellite_system['id']})"
end