Created
April 23, 2020 04:32
-
-
Save rohanpm/e13b248deeadb8691150c90cd53fd1e2 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 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