Created
April 3, 2018 14:29
-
-
Save moio/6e4475a313d04aafdd4d0e1b269ed10c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import xmlrpclib | |
if len(sys.argv) != 5: | |
print("Usage: change_channels.py <SUSE MANAGER HOSTNAME> <USERNAME> <PASSWORD> <NEW BASE CHANNEL>") | |
sys.exit(1) | |
_, hostname, username, password, channel = sys.argv | |
manager_url = "http://" + hostname + "/rpc/api" | |
client = xmlrpclib.Server(manager_url, verbose=0) | |
key = client.auth.login(username, password) | |
for system in client.system.listSystems(key): | |
client.system.setBaseChannel(key, system["id"], channel) | |
print("Done %s" % system["name"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment