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
|