Class: Channel

Inherits:
Sif::Loader show all
Defined in:
lib/channel.rb

Instance Method Summary collapse

Methods inherited from Sif::Loader

#initialize

Constructor Details

This class inherits a constructor from Sif::Loader

Instance Method Details

#create(channel_label) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/channel.rb', line 26

def create(channel_label)
  server = XMLRPC::Client.new(@spacewalk_server, "/rpc/api", 80)
  puts "Creating #{channel_label}"
  puts "Name #{options[:name]}"
  puts "Summary #{options[:summary]}"
  puts "Arch #{options[:arch]}"
  puts "Parent #{options[:parent]}"
  puts "Checksum #{options[:checksum]}"
  name = options[:name]
  summary = options[:summary]
  archLabel = "channel-#{options[:arch]}"   
  parent = options[:parent]
  checksum = options[:checksum]

  begin
    key = server.call("auth.login", @username, @password)
    puts "Using session key #{key}"
    out = server.call("channel.software.create", 
          key,
          channel_label,
          name,
          summary,
          archLabel,
          parent,
          checksum
          )
    puts out
  rescue XMLRPC::FaultException => e
    puts "Error:"
    puts e.faultCode
    puts e.faultString
  end
end

#refresh(channel_label) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/channel.rb', line 11

def refresh(channel_label)

    puts "Regenerating YUM cache for #{channel_label}"
    channel_api = Buzz::Api::Channel.new(@spacewalk_server, @username, @password)
    response = channel_api.refresh_channel(channel_label)
    puts "RES #{response}"

end