[Spacewalk-list] Cloning channel from script

Alexander Dacre alex.dacre at aridhia.com
Mon May 11 15:29:01 UTC 2015


Hi,

This is simple to do with the API via channel.software.mergePackages and channel.software.mergeErrata.

Although I’m used to working with Golang, the below should do half of what you want. You could easily modify it. Please note it has not been tested.

import xmlrpclib
import getpass
import os
import sys
import subprocess

SATELLITE_URL = raw_input("Spacewalk API adddress: ")
SATELLITE_LOGIN = raw_input("Spacewalk username: ")
SATELLITE_PASSWORD = getpass.getpass()

SOURCE = raw_input("Source channel label: ")
DESTINATION = raw_input("Destination channel label: ")

client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)

merged_packages = client.channel.software.mergePackages(key, SOURCE, DESTINATION)

# do something with merged_packages
# e.g. send merge summary via e-mail.
client.auth.logout(key)




Alex Dacre
Systems Engineer
+44 131 560 1466

From: spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Darryl Baker
Sent: 11 May 2015 16:09
To: spacewalk-list at redhat.com
Subject: [Spacewalk-list] Cloning channel from script

I’m using Red Hat Satellite 5.7. Each month I clone the distribution channels so I can have sets of machines at the identical patch level and those patches can be worked through the testing cycle before being applied in production. Currently I am doing this manually through the GUI. A mindless, time consuming thing. I would like to set up scripts to do this for me. Any clues on how to do this will be much appreciated.



Regards,

Darryl Baker
Textura Corporation
Linux Engineer Application Support
1405 Lake Cook Road
Deerfield, Illinois 60015
Office Phone - 847-235-8467
Email – darryl.baker at texturacorp.com<mailto:darryl.baker at texturacorp.com>
[cid:05DC2306-1083-4864-A07C-DE5DA45A6302]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20150511/c4489f0a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7456 bytes
Desc: image001.png
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20150511/c4489f0a/attachment.png>


More information about the Spacewalk-list mailing list