ia64/xen-unstable

view tools/python/xen/xm/loadpolicy.py @ 9835:cf20dbbf5c2b

This patch adds new python access control management scripts, which
integrate into Xen Management and which support the new access control
labels (labels replace the ssidref numbers at the management user
interface).

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
author smh22@firebug.cl.cam.ac.uk
date Mon Apr 24 10:58:25 2006 +0100 (2006-04-24)
parents
children 88dc1ae16d2b
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) 2006 International Business Machines Corp.
16 # Author: Reiner Sailer <sailer@us.ibm.com>
17 #============================================================================
19 """Loading a compiled binary policy into the hypervisor.
20 """
21 import sys
22 import traceback
23 import os
24 import commands
25 import shutil
26 import string
27 from xen.util.security import ACMError, err, load_policy
30 def usage():
31 print "\nUsage: xm loadpolicy <policy>\n"
32 print " Load the compiled binary (.bin) policy"
33 print " into the running hypervisor.\n"
34 err("Usage")
36 def main(argv):
37 try:
38 if len(argv) != 2:
39 usage()
40 load_policy(argv[1])
41 except ACMError:
42 pass
43 except:
44 traceback.print_exc(limit=1)
48 if __name__ == '__main__':
49 main(sys.argv)