cobbler_api_hook_for_vm_creation
This is an old revision of the document!
#!/bin/env python import sys import re import xmlrpclib import cobbler.api as capi automagick = xmlrpclib.Server("http://automagick01vm.ewr1.pokkari.net/cobbler_api") #Get required information from user for vm creation: if len(sys.argv) < 3: print ("usage: sys.argv[0] hostname") sys.exit(1) def check_hostname (hostname): if len(automagick.find_system({"hostname":hostname})) == 0: return hostname else: print "already exists. please pass switch to reinstall" sys.exit(1) vm_hostname = check_hostname(sys.argv[1]) print vm_hostname ~ ~
cobbler_api_hook_for_vm_creation.1311882575.txt.gz ยท Last modified: 2020/08/10 02:28 (external edit)