
#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, 'infraDefault', 'Default key for infrastructure org',
INFRA_PARENT, INFRA_ENTITLE, False)
#Add child channels
client.activationkey.addChildChannels(key, infra_ak, INFRA_CHILDREN)
#Add packages
client.activationkey.addPackageNames(key, infra_ak, INFRA_PACKAGES)
#log out from infrastructure channel
client.auth.logout(key)
"""
Create tenant key
"""
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(TENANT_LOGIN, TENANT_PASSWD)
tenant_ak = client.activationkey.create(key, 'tenantDefault', 'Default key for tenant org',
TENANT_PARENT, TENANT_ENTITLE, True)
client.activationkey.addChildChannels(key, tenant_ak, TENANT_CHILDREN)
client.activationkey.addPackageNames(key, tenant_ak, TENANT_PACKAGES)
client.auth.logout(key)
print "Default Infrastructure activation key: ", infra_ak
print "Default Tenant activation key: ", tenant_ak
c) createMRGActKeys.py – create activation keys for MRG systems
#!/usr/bin/python
"""
This script will create the activation keys for the MRG Grid Manager (infrastructure org)
and MRG Grid Execute Node (tenant org)
"""
import xmlrpclib
SATELLITE_URL = "http://sat-vm.cloud.lab.eng.bos.redhat.com/rpc/api"
61 www.redhat.com
Comentarios a estos manuales