ia64/xen-unstable

changeset 17035:7fd49c55c0b0

xen-api: Fix some errors in Xen-API's PBD class.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 11 14:51:22 2008 +0000 (2008-02-11)
parents e3b7f1793f0c
children 7b0c0ab0566b
files tools/python/xen/xend/XendPBD.py
line diff
     1.1 --- a/tools/python/xen/xend/XendPBD.py	Mon Feb 11 14:50:50 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendPBD.py	Mon Feb 11 14:51:22 2008 +0000
     1.3 @@ -20,6 +20,7 @@ import uuid
     1.4  from XendLogging import log
     1.5  from xen.xend.XendBase import XendBase
     1.6  from xen.xend import XendAPIStore
     1.7 +from xen.xend import uuid as genuuid
     1.8  
     1.9  class XendPBD(XendBase):
    1.10      """Physical block devices."""
    1.11 @@ -39,8 +40,7 @@ class XendPBD(XendBase):
    1.12          return XendBase.getAttrRW() + attrRW
    1.13  
    1.14      def getAttrInst(self):
    1.15 -        return ['uuid',
    1.16 -                'host',
    1.17 +        return ['host',
    1.18                  'SR',
    1.19                  'device_config']
    1.20  
    1.21 @@ -61,31 +61,31 @@ class XendPBD(XendBase):
    1.22      getFuncs    = classmethod(getFuncs)
    1.23  
    1.24      def recreate(uuid, record):
    1.25 -        pbd = XendPBD(uuid, record)
    1.26 +        pbd = XendPBD(record, uuid)
    1.27          return uuid
    1.28      
    1.29      def create(cls, record):
    1.30          uuid = genuuid.createString()
    1.31 -        pbd = XendPBD(uuid, record)
    1.32 -        return uuid       
    1.33 +        pbd = XendPBD(record, uuid)
    1.34 +        return uuid
    1.35  
    1.36      create = classmethod(create)
    1.37      
    1.38 -    def __init__(self, uuid, record):
    1.39 +    def __init__(self, record,  uuid):
    1.40          XendBase.__init__(self, uuid, record)
    1.41 -        this.currently_attached = True
    1.42 +        self.currently_attached = True
    1.43  
    1.44      def get_host(self):
    1.45 -        return this.host
    1.46 +        return self.host
    1.47      
    1.48      def get_SR(self):
    1.49 -        return this.SR
    1.50 +        return self.SR
    1.51  
    1.52      def get_device_config(self):
    1.53 -        return this.device_config
    1.54 +        return self.device_config
    1.55  
    1.56      def get_currently_attached(self):
    1.57 -        return this.currently_attached
    1.58 +        return self.currently_attached
    1.59  
    1.60      def destroy(self):
    1.61          pass