Skip to content

Instantly share code, notes, and snippets.

@markcaudill
Created July 4, 2013 19:05
Show Gist options
  • Save markcaudill/5929681 to your computer and use it in GitHub Desktop.
Save markcaudill/5929681 to your computer and use it in GitHub Desktop.
#!/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'])
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment