source: trunk/vnc/vnc_server/get_port.py @ 225

Last change on this file since 225 was 115, checked in by ecprice, 17 years ago

VNC server commit.

File size: 614 bytes
RevLine 
[115]1#!/usr/bin/python
2import sys
3import glob
4sys.path.append('/usr/lib/xen-default/lib/python/')
5import xen.xm
6import xen.xm.XenAPI
7import xen.xend.XendClient
8
9server = xen.xm.XenAPI.Session(xen.xend.XendClient.uri)
10
11def findPort(name):
12    states = server.xend.domains_with_state(True, 'all', 1)
13    for state in states:
14        if dict(state[1:])['name'] == name:
15            for (key,value) in state[1:]:
16                if key == 'device' and value[0] == 'vfb':
17                    location=dict(value[1:]).get('location')
18                    return location
19
20if __name__ == '__main__':
21    print findPort("moo3")
Note: See TracBrowser for help on using the repository browser.