Thanks, Matt.

I've actually written a small application in Go (it's about time that compiled 
languages made a comeback, right?) that uses the XML-RPC API to do this 
instead. Configuration is driven JSON files similar to those used by 
merge-channel-by-date. I'll speak to my superiors tomorrow and see if they will 
let me put it up on Github.


Thanks,

Alex


________________________________
From: [email protected] <[email protected]> on 
behalf of Matthew Madey <[email protected]>
Sent: Monday, July 21, 2014 5:39 PM
To: [email protected]
Subject: Re: [Spacewalk-list] Content Merge - Child Channels

Alex,

Using the api in a python script is probably the best way to do this. I set up 
a cron job to merge packages.

I simply create two arrays, one for source channels and one for destination 
channels like so:


## Source and Destination Channels. All items must be positioned identically in 
the corresponding lists!
src_channels = ['rhel-x86_64-server-6-base', 'rhel-x86_64-server-6-base-epel', 
'rhel-x86_64-server-6-base-hpsa', 'rhel-x86_64-server-6-base-optional', 
'rhel-x86_64-server-6-base-puppet-dependencies', 
'rhel-x86_64-server-6-base-puppet-product', 
'rhel-x86_64-server-6-base-spacewalk-client', 
'rhel-x86_64-server-6-base-thd-tools', 'rhel-x86_64-server-6-base-tools', 
'rhel-x86_64-server-6-base-updates']
dst_channels = ['rhel-x86_64-server-6-stores', 
'rhel-x86_64-server-6-stores-epel', 'rhel-x86_64-server-6-stores-hpsa', 
'rhel-x86_64-server-6-stores-optional', 
'rhel-x86_64-server-6-stores-puppet-dependencies', 
'rhel-x86_64-server-6-stores-puppet-product', 
'rhel-x86_64-server-6-stores-spacewalk-client', 
'rhel-x86_64-server-6-stores-thd-tools', 'rhel-x86_64-server-6-stores-tools', 
'rhel-x86_64-server-6-stores-updates']

print "Merging selected channels!"

client.channel.software.mergePackages(key, src_channels[0], dst_channels[0])
client.channel.software.mergePackages(key, src_channels[1], dst_channels[1])
client.channel.software.mergePackages(key, src_channels[2], dst_channels[2])
client.channel.software.mergePackages(key, src_channels[3], dst_channels[3])
client.channel.software.mergePackages(key, src_channels[4], dst_channels[4])
client.channel.software.mergePackages(key, src_channels[5], dst_channels[5])
client.channel.software.mergePackages(key, src_channels[6], dst_channels[6])
client.channel.software.mergePackages(key, src_channels[7], dst_channels[7])
client.channel.software.mergePackages(key, src_channels[8], dst_channels[8])
client.channel.software.mergePackages(key, src_channels[9], dst_channels[9])

print "All channels have been synchronized!"

client.auth.logout(key)


I'm no expert on python, so I'm sure there's a more pythonic way to do this, 
but it works.



On Fri, Jul 18, 2014 at 7:50 AM, Alexander Dacre 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

Firstly, apologies if this appears as a duplicate post - first mailing list.

The spacewalk-clone-by data command seems great, but it only seems to do 
packages with errata?

If I was to just keep channels in sync from a package point of view and ignore 
errata, what would be the best way? I'm currently using the spacewalk-api and 
channel.software.mergePackages.

Thanks,
Alex


_______________________________________________
Spacewalk-list mailing list
[email protected]<mailto:[email protected]>
https://www.redhat.com/mailman/listinfo/spacewalk-list

_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list

Reply via email to