ia64/xen-unstable

changeset 10582:767ce4b6dd48

More commented-out code, pending a solution to the xml.marshall.generic
problem.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Jun 28 17:42:05 2006 +0100 (2006-06-28)
parents ca3f2a137159
children 5fa6c1723e08
files tools/python/xen/xm/addlabel.py tools/python/xen/xm/getlabel.py tools/python/xen/xm/resources.py tools/python/xen/xm/rmlabel.py
line diff
     1.1 --- a/tools/python/xen/xm/addlabel.py	Wed Jun 28 17:36:38 2006 +0100
     1.2 +++ b/tools/python/xen/xm/addlabel.py	Wed Jun 28 17:42:05 2006 +0100
     1.3 @@ -22,7 +22,7 @@
     1.4  import sys, os
     1.5  import string
     1.6  import traceback
     1.7 -from xml.marshal import generic
     1.8 +#from xml.marshal import generic
     1.9  from xen.util import security
    1.10  
    1.11  def usage():
    1.12 @@ -88,7 +88,7 @@ def add_resource_label(label, resource, 
    1.13              access_control = {}
    1.14          else:
    1.15              fd = open(file, "rb")
    1.16 -            access_control = generic.load(fd)
    1.17 +#            access_control = generic.load(fd)
    1.18              fd.close()
    1.19  
    1.20          if access_control.has_key(resource):
    1.21 @@ -98,7 +98,7 @@ def add_resource_label(label, resource, 
    1.22          new_entry = { resource : tuple([policyref, label]) }
    1.23          access_control.update(new_entry)
    1.24          fd = open(file, "wb")
    1.25 -        generic.dump(access_control, fd)
    1.26 +#        generic.dump(access_control, fd)
    1.27          fd.close()
    1.28  
    1.29      except security.ACMError:
     2.1 --- a/tools/python/xen/xm/getlabel.py	Wed Jun 28 17:36:38 2006 +0100
     2.2 +++ b/tools/python/xen/xm/getlabel.py	Wed Jun 28 17:42:05 2006 +0100
     2.3 @@ -21,7 +21,7 @@
     2.4  import sys, os, re
     2.5  import string
     2.6  import traceback
     2.7 -from xml.marshal import generic
     2.8 +#from xml.marshal import generic
     2.9  from xen.util import security
    2.10  
    2.11  def usage():
    2.12 @@ -38,7 +38,7 @@ def get_resource_label(resource):
    2.13          file = security.res_label_filename
    2.14          if os.path.isfile(file):
    2.15              fd = open(file, "rb")
    2.16 -            access_control = generic.load(fd)
    2.17 +#            access_control = generic.load(fd)
    2.18              fd.close()
    2.19          else:
    2.20              print "Resource label file not found"
     3.1 --- a/tools/python/xen/xm/resources.py	Wed Jun 28 17:36:38 2006 +0100
     3.2 +++ b/tools/python/xen/xm/resources.py	Wed Jun 28 17:42:05 2006 +0100
     3.3 @@ -21,7 +21,7 @@
     3.4  import sys, os
     3.5  import string
     3.6  import traceback
     3.7 -from xml.marshal import generic
     3.8 +#from xml.marshal import generic
     3.9  from xen.util import security
    3.10  
    3.11  def usage():
    3.12 @@ -48,7 +48,7 @@ def get_resource_data():
    3.13          security.err("Resource file not found.")
    3.14  
    3.15      fd = open(file, "rb")
    3.16 -    access_control = generic.load(fd)
    3.17 +#    access_control = generic.load(fd)
    3.18      fd.close()
    3.19      return access_control
    3.20  
     4.1 --- a/tools/python/xen/xm/rmlabel.py	Wed Jun 28 17:36:38 2006 +0100
     4.2 +++ b/tools/python/xen/xm/rmlabel.py	Wed Jun 28 17:42:05 2006 +0100
     4.3 @@ -21,7 +21,7 @@
     4.4  import sys, os, re
     4.5  import string
     4.6  import traceback
     4.7 -from xml.marshal import generic
     4.8 +#from xml.marshal import generic
     4.9  from xen.util import security
    4.10  
    4.11  def usage():
    4.12 @@ -41,7 +41,7 @@ def rm_resource_label(resource):
    4.13          file = security.res_label_filename
    4.14          if os.path.isfile(file):
    4.15              fd = open(file, "rb")
    4.16 -            access_control = generic.load(fd)
    4.17 +#            access_control = generic.load(fd)
    4.18              fd.close()
    4.19          else:
    4.20              security.err("Resource file not found, cannot remove label!")
    4.21 @@ -50,7 +50,7 @@ def rm_resource_label(resource):
    4.22          if access_control.has_key(resource):
    4.23              del access_control[resource]
    4.24              fd = open(file, "wb")
    4.25 -            generic.dump(access_control, fd)
    4.26 +#            generic.dump(access_control, fd)
    4.27              fd.close()
    4.28          else:
    4.29              security.err("Label does not exist in resource label file.")