boot_url.py 293 Bytes
Newer Older
Őry Máté committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/python

import base64
import xmltodict
import urllib2
import sys

xml = base64.b64decode(sys.argv[1])
data = xmltodict.parse(xml)
try:
    booturl = data["VM"]["TEMPLATE"]["CONTEXT"]["BOOTURL"]
except:
    print 'Error'
req=urllib2.Request(booturl)
response = urllib2.urlopen(req)