<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Thanks, Matt.<br>
</p>
<p><br>
</p>
<p>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.<br>
</p>
<p><br>
</p>
<p>Thanks,<br>
</p>
<p>Alex<br>
</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> spacewalk-list-bounces@redhat.com <spacewalk-list-bounces@redhat.com> on behalf of Matthew Madey <mattmadey@gmail.com><br>
<b>Sent:</b> Monday, July 21, 2014 5:39 PM<br>
<b>To:</b> spacewalk-list@redhat.com<br>
<b>Subject:</b> Re: [Spacewalk-list] Content Merge - Child Channels</font>
<div> </div>
</div>
<div>
<div dir="ltr">Alex,
<div><br>
</div>
<div>Using the api in a python script is probably the best way to do this. I set up a cron job to merge packages.</div>
<div><br>
</div>
<div>I simply create two arrays, one for source channels and one for destination channels like so:</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>## Source and Destination Channels. All items must be positioned identically in the corresponding lists!</div>
<div>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']</div>
<div>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']</div>
<div><br>
</div>
<div>print "Merging selected channels!"<br>
</div>
<div><br>
</div>
<div>client.channel.software.mergePackages(key, src_channels[0], dst_channels[0])</div>
<div>client.channel.software.mergePackages(key, src_channels[1], dst_channels[1])</div>
<div>client.channel.software.mergePackages(key, src_channels[2], dst_channels[2])</div>
<div>client.channel.software.mergePackages(key, src_channels[3], dst_channels[3])</div>
<div>client.channel.software.mergePackages(key, src_channels[4], dst_channels[4])</div>
<div>client.channel.software.mergePackages(key, src_channels[5], dst_channels[5])</div>
<div>client.channel.software.mergePackages(key, src_channels[6], dst_channels[6])</div>
<div>client.channel.software.mergePackages(key, src_channels[7], dst_channels[7])</div>
<div>client.channel.software.mergePackages(key, src_channels[8], dst_channels[8])</div>
<div>client.channel.software.mergePackages(key, src_channels[9], dst_channels[9])</div>
<div><br>
</div>
<div>print "All channels have been synchronized!"</div>
<div><br>
</div>
<div>client.auth.logout(key)</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>I'm no expert on python, so I'm sure there's a more pythonic way to do this, but it works. </div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Jul 18, 2014 at 7:50 AM, Alexander Dacre <span dir="ltr">
<<a href="mailto:alex.dacre@aridhia.com" target="_blank">alex.dacre@aridhia.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Hi,<br>
<br>
Firstly, apologies if this appears as a duplicate post - first mailing list.<br>
<br>
The spacewalk-clone-by data command seems great, but it only seems to do packages with errata?<br>
<br>
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.<br>
<br>
Thanks,<br>
Alex<br>
<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>