
"""
#open channel
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
#log into infrastructure org
key = client.auth.login(INFRA_LOGIN, INFRA_PASSWD)
#create key
infra_ak = client.activationkey.create(key, 'RHELH', 'Key for RHEL/KVM based RHEL
Hosts', INFRA_PARENT, INFRA_ENTITLE.splitlines(), False)
#Add child channels
client.activationkey.addChildChannels(key, infra_ak, INFRA_CHILDREN.splitlines())
#Add packages
client.activationkey.addPackageNames(key, infra_ak, INFRA_PACKAGES.splitlines())
#log out from infrastructure channel
client.auth.logout(key)
ii) importKS_infra.py – import supplied kickstart into the infrastructure organization
#!/usr/bin/python
"""
This script will attempt to create a kickstart form the content of the file passed.
The ks name will be derived from the filename - if basename less than 6 chars date is appended
the org, kstree and VIRT type are determined by the global variable below
"""
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 = "infra"
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]
www.redhat.com 66
Comentarios a estos manuales