Red Hat SATELLITE 5.3.0 RELEASE NOTES Technické informace Strana 67

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 199
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 66
filePtr = open(fileName, 'r')
ksName = os.path.basename(fileName).split('.')[0]
if len(ksName) < 6:
today = datetime.date.today()
ksName = ksName + '_' + today.strftime("%m%d")
#open channel
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
#log into infrastructure org
key = client.auth.login(INFRA_LOGIN, INFRA_PASSWD)
client.kickstart.importFile(key, ksName, VIRT, KSTREE, filePtr.read())
#log out from infrastructure channel
client.auth.logout(key)
if __name__ == "__main__":
sys.exit(main())
iii) assocKeyKS_infra.py – Associate an activation key with an existing kickstart
#!/usr/bin/python
"""
This script will attempt to associate the passed activation key to the kickstart
related to the label that was passed. the org is determined by the login global variable below
"""
import xmlrpclib
import sys
SATELLITE_URL = "http://sat-vm.cloud.lab.eng.bos.redhat.com/rpc/api"
INFRA_LOGIN = "infra"
INFRA_PASSWD = "24^gold"
def main():
if len(sys.argv) < 3:
print "Usage: ",sys.argv[0]," activationKey kickstart"
sys.exit(-2);
# retreieve the passed parameter
AKName = sys.argv[1]
KSName = sys.argv[2].split(':')[0]
67 www.redhat.com
Zobrazit stránku 66
1 2 ... 62 63 64 65 66 67 68 69 70 71 72 ... 198 199

Komentáře k této Příručce

Žádné komentáře