Skip to content

Instantly share code, notes, and snippets.

@rohanpm
Created April 23, 2020 04:32
Show Gist options
  • Select an option

  • Save rohanpm/e13b248deeadb8691150c90cd53fd1e2 to your computer and use it in GitHub Desktop.

Select an option

Save rohanpm/e13b248deeadb8691150c90cd53fd1e2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import logging
from kobo.client import HubProxy
from kobo.conf import PyConfigParser
logging.basicConfig(level=logging.DEBUG)
URL = 'https://pub.devel.redhat.com/pub/xmlrpc'
conf = PyConfigParser()
conf.load_from_dict({
'HUB_URL': URL,
'AUTH_METHOD': 'gssapi',
'DEBUG_XMLRPC': 1,
'CA_CERT': '/etc/pki/tls/certs/ca-bundle.crt',
'KRB_REALM': 'IPA.REDHAT.COM',
})
proxy = HubProxy(conf, logger=logging.getLogger())
# This request doesn't need auth.
workers = proxy.client.list_workers()
print(workers)
# This request does (you'll need to be an admin).
info = proxy.client.get_worker_info(workers[0])
print(info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment