xen-vtx-unstable

view tools/python/xen/xend/server/SrvRoot.py @ 6774:4d899a738d59

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 15:05:49 2005 +0000 (2005-09-13)
parents dd668f7527cb
children
line source
1 #============================================================================
2 # This library is free software; you can redistribute it and/or
3 # modify it under the terms of version 2.1 of the GNU Lesser General Public
4 # License as published by the Free Software Foundation.
5 #
6 # This library is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 # Lesser General Public License for more details.
10 #
11 # You should have received a copy of the GNU Lesser General Public
12 # License along with this library; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 #============================================================================
15 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
16 #============================================================================
18 from xen.xend import XendRoot
19 xroot = XendRoot.instance()
20 from xen.web.SrvDir import SrvDir
22 class SrvRoot(SrvDir):
23 """The root of the xend server.
24 """
26 """Server sub-components. Each entry is (name, class), where
27 'name' is the entry name and 'class' is the name of its class.
28 """
29 #todo Get this list from the XendRoot config.
30 subdirs = [
31 ('node', 'SrvNode' ),
32 ('domain', 'SrvDomainDir' ),
33 ('vnet', 'SrvVnetDir' ),
34 ]
36 def __init__(self):
37 SrvDir.__init__(self)
38 for (name, klass) in self.subdirs:
39 self.add(name, klass)
40 for (name, klass) in self.subdirs:
41 self.get(name)
42 xroot.start()
44 def __repr__(self):
45 return "<SrvRoot %x %s>" %(id(self), self.table.keys())