Using Python with RHN API

Why use RHN API ?

  • RHN APU can be used to automate tasks for managing systems .
  • Connect to the Satellite server via XML-RPC library

See example below to get started, here is sample Python script :

Sample Python Script
import xmlrpclib
URL = ""
user = "rhn-username"
pswd = "rhn-password"
client = xmlrpclib.Server(URL, verbose=0)
session = client.auth.login(user, pswd)
list = client.user.list_assigned_system_groups(session, user)
for group in list:
print group.get('name')