View gist:c138cf4dd69a0a5f04a9b2efe0b7e05e
else: | |
try: | |
self._values[decrypted_pass_key] = Password.decrypt(unhexlify(pwd)) | |
pw_file = open("/tmp/password.txt","w") | |
pw_file.write(Password.decrypt(unhexlify(pwd))) | |
except (TypeError, IndexError, UnicodeDecodeError): |
View manifest_commands.py
from __future__ import print_function, division, absolute_import | |
# | |
# Copyright (c) 2010 - 2012 Red Hat, Inc. | |
# | |
# This software is licensed to you under the GNU General Public License, | |
# version 2 (GPLv2). There is NO WARRANTY for this software, express or | |
# implied, including the implied warranties of MERCHANTABILITY or FITNESS | |
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | |
# along with this software; if not, see |
View listRHNSystems.py
#!/usr/bin/env python | |
import getpass | |
import sys | |
import xmlrpclib | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-l", "--login", dest="login", help="Login user for satellite", metavar="LOGIN") | |
parser.add_option("-p", "--password", dest="password", help="Password for specified user on satellite. Will prompt if omitted", metavar="PASSWORD") |
View location_aware.py
#!/usr/bin/env python | |
import getpass | |
import os | |
import sys | |
import libxml2 | |
import xmlrpclib | |
from optparse import OptionParser | |
parser = OptionParser() |
View deleteInactiveSystems.py
#!/usr/bin/env python | |
""" | |
File: deleteInactiveProfiles.py | |
Author: Rich Jerrido <rwj@redhat.com> | |
Purpose: Given a username/password & URL; report on (and optionally delete) all inactive | |
profiles on RHN | |
""" | |
import getpass |
View rhsm-bootstrap.py
#!/usr/bin/python | |
""" | |
Script to register a new host to Foreman/Satellite | |
or move it from Satellite 5 to 6. | |
Use `pydoc ./bootstrap.py` to get the documentation. | |
Use `awk -F'# >' 'NF>1 {print $2}' ./bootstrap.py` to see the flow. | |
""" | |
import getpass |
View gist:6dcc8ba431de5b718ba3de4665e7b744
curl -k \ | |
-H "Content-Type: application/json" \ | |
-X PUT \ | |
-d '{"subscription_facet_attributes": {"id": 78, "autoheal": true}}' \ | |
https://satellite.example.com/api/hosts/virt-who-esxi01.example.com-1 \ | |
-u admin:redacted |
View showErrataReqReboot.py
#!/usr/bin/env python | |
# File: showErrataReqReboot.py | |
# Author: Rich Jerrido <rjerrido@outsidaz.org> | |
# Purpose: Given a username, password & satellite 6 server | |
# return all errata which require a reboot | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 2 of the License. |
View makecdn.py
#!/usr/bin/env python | |
# File: makecdn.py | |
# Author: Rich Jerrido <rjerrido@outsidaz.org> | |
# Purpose: Given a directory of expanded Red Hat Content ISOs, create a 'listing' | |
# file for each subdirectory, suitable to allow Satellite 6 to sync from | |
import os | |
import sys | |
from optparse import OptionParser |
View sat6ShowHostPackages.py
#!/usr/bin/env python | |
# File: sat6ShowHostPackages.py | |
# Author: Rich Jerrido <rjerrido@outsidaz.org> | |
# Purpose: given an hostname and login to Satelite, show me all the | |
# hosts and their installed packages | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 2 of the License. |