66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
for line in output.split("\n"):
if url is not None:
continue
idx = line.find("address:")
if idx != -1:
url = line[idx+9:]
if url.startswith('*:'):
url = "localhost"+url[1:]
if url is None:
print >>sys.stderr, "ERROR parsing 'info spice' output:",output
return None
return "spice://" + url.rstrip('\r')
|
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
for line in output.split("\n"):
if url is not None:
continue
idx = line.find("address:")
if idx != -1:
url = line[idx+9:]
if url.startswith('*:'):
url = socket.getfqdn()+url[1:]
if url is None:
print >>sys.stderr, "ERROR parsing 'info spice' output:",output
return None
return "spice://" + url.rstrip('\r')
|