
SATELLITE_URL = "http://sat-vm.cloud.lab.eng.bos.redhat.com/rpc/api"
INFRA_LOGIN = "tenant"
INFRA_PASSWD = "24^gold"
KSTREE = 'ks-rhel-x86_64-server-5-u5'
VIRT = "none"
def main():
if len(sys.argv) < 2:
print "Usage: ",sys.argv[0]," kickstart"
sys.exit(-2);
# retreieve the passed parameter
fileName = sys.argv[1]
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())
iv) assocKeyKS_tenant.py – associates an existing activation key with an existing
kickstart for the tenant organization
#!/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"
75 www.redhat.com
Komentáře k této Příručce