Created
July 4, 2013 19:05
-
-
Save markcaudill/5929681 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 xmlrpclib | |
SAT_URL = "https://<SATELLITE_IP>/rpc/api" | |
SAT_USER = "<USERNAME>" | |
SAT_PASS = "<PASSWORD>" | |
client = xmlrpclib.Server(SAT_URL, verbose=0) | |
key = client.auth.login(SAT_USER, SAT_PASS) | |
syslist = client.system.listSystems(key) | |
systems = {} | |
for system in syslist: | |
systems[system['name']] = client.system.listPackages(key, system['id']) | |
# Print out list in a Markdown-like format. | |
for system in sorted(systems.keys()): | |
print '%s' % system | |
print '=' * len(system) | |
for package in systems[system]: | |
print '- %s %s' % (package['name'], package['version']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment