Last active
August 29, 2015 13:58
-
-
Save jctanner/10051651 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/env python | |
import xmlrpclib, httplib, sys | |
from operator import itemgetter | |
SATELLITE_URL = "http://xmlrpc.rhn.redhat.com/rpc/api" | |
SATELLITE_LOGIN = "RHN_USERNAME" | |
SATELLITE_PASSWORD = "RHN_PASSWORD" | |
client = xmlrpclib.Server(SATELLITE_URL, verbose=0) | |
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD) | |
systems = client.system.listUserSystems(key,SATELLITE_LOGIN) | |
newlist = sorted(systems, key=itemgetter('last_checkin')) | |
#for i in systems: | |
for i in newlist: | |
print i.get('id'),i.get('name'),i.get('last_checkin') | |
client.auth.logout(key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment