Red Hat SATELLITE 5.3.0 RELEASE NOTES Informacje Techniczne Strona 77

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 199
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 76
if __name__ == "__main__":
sys.exit(main())
v) addGPGKey_tenant.py - loads the GPG key into satellite and associates it with
a stated kickstart
#!/usr/bin/python
"""
This script will attempt to add a GPG key to an existing kickstart
"""
import xmlrpclib
import os.path
import sys
import time
import datetime
SATELLITE_URL = "http://sat-vm.cloud.lab.eng.bos.redhat.com/rpc/api"
INFRA_LOGIN = "tenant"
INFRA_PASSWD = "24^gold"
def main():
if len(sys.argv) < 3:
print "Usage: ",sys.argv[0]," kickstart GPGKEY_pub.txt"
sys.exit(-2);
# retreieve the passed parameter
kickstart = sys.argv[1]
fileName = sys.argv[2]
filePtr = open(fileName, 'r')
kDesc = os.path.basename(fileName).split('.')[0]
#open channel
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
#log into infrastructure org
key = client.auth.login(INFRA_LOGIN, INFRA_PASSWD)
# create key
client.kickstart.keys.create(key, kDesc, 'GPG', filePtr.read())
# add key to kicktart
client.kickstart.profile.system.addKeys(key, kickstart, [ kDesc ])
#log out from infrastructure channel
client.auth.logout(key)
if __name__ == "__main__":
sys.exit(main())
77 www.redhat.com
Przeglądanie stron 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 198 199

Komentarze do niniejszej Instrukcji

Brak uwag