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: [email protected]
[mailto:[email protected]] On Behalf Of Darryl Baker
Sent: 11 May 2015 16:09
To: [email protected]
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 – [email protected]<mailto:[email protected]>
[cid:05DC2306-1083-4864-A07C-DE5DA45A6302]
_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list