boot_url.py 359 Bytes
Newer Older
Őry Máté committed
1 2 3 4 5 6 7 8 9 10 11
#!/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"]
tarokkk committed
12 13 14
    (drop, b) = booturl.split(".hu", 1)
    req=urllib2.Request("http://localhost:8080"+b)
    response = urllib2.urlopen(req)
Őry Máté committed
15 16 17
except:
    print 'Error'