ia64/xen-unstable

changeset 14575:effef488d448

Fix xm info etc since changes to Session in XenAPI

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Tom Wilkie <tom.wilkie@gmail.com>
date Mon Mar 26 16:04:24 2007 +0100 (2007-03-26)
parents 3b2efc3cf6b6
children 5a60095a2299
files tools/python/xen/xm/XenAPI.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/XenAPI.py	Mon Mar 26 15:09:24 2007 +0100
     1.2 +++ b/tools/python/xen/xm/XenAPI.py	Mon Mar 26 16:04:24 2007 +0100
     1.3 @@ -112,6 +112,9 @@ class Session(xen.util.xmlrpclib2.Server
     1.4          self.last_login_params = None
     1.5  
     1.6  
     1.7 +    def getSession(self):
     1.8 +        return self._session
     1.9 +
    1.10      def xenapi_request(self, methodname, params):
    1.11          if methodname.startswith('login'):
    1.12              self._login(methodname, params)
     2.1 --- a/tools/python/xen/xm/main.py	Mon Mar 26 15:09:24 2007 +0100
     2.2 +++ b/tools/python/xen/xm/main.py	Mon Mar 26 16:04:24 2007 +0100
     2.3 @@ -850,7 +850,8 @@ def parse_doms_info(info):
     2.4  
     2.5  def check_sched_type(sched):
     2.6      if serverType == SERVER_XEN_API:
     2.7 -        current = server.xenapi.host.get_sched_policy(server.xenapi.session.get_this_host())
     2.8 +        current = server.xenapi.host.get_sched_policy(
     2.9 +            server.xenapi.session.get_this_host(server.getSession()))
    2.10      else:
    2.11          current = 'unknown'
    2.12          for x in server.xend.node.info()[1:]:
    2.13 @@ -1044,7 +1045,7 @@ def xm_vcpu_list(args):
    2.14  
    2.15              if serverType == SERVER_XEN_API:
    2.16                  nr_cpus = len(server.xenapi.host.get_host_CPUs(
    2.17 -                    server.xenapi.session.get_this_host()))
    2.18 +                    server.xenapi.session.get_this_host(server.getSession())))
    2.19              else:
    2.20                  for x in server.xend.node.info()[1:]:
    2.21                      if len(x) > 1 and x[0] == 'nr_cpus':
    2.22 @@ -1509,7 +1510,7 @@ def xm_info(args):
    2.23          # Need to fake out old style xm info as people rely on parsing it
    2.24          
    2.25          host_record = server.xenapi.host.get_record(
    2.26 -            server.xenapi.session.get_this_host())        
    2.27 +            server.xenapi.session.get_this_host(server.getSession()))
    2.28  
    2.29          host_cpu_records = map(server.xenapi.host_cpu.get_record, host_record["host_CPUs"])
    2.30  
    2.31 @@ -1686,7 +1687,7 @@ def xm_debug_keys(args):
    2.32      
    2.33      if serverType == SERVER_XEN_API:
    2.34          server.xenapi.host.send_debug_keys(
    2.35 -            server.xenapi.session.get_this_host(),
    2.36 +            server.xenapi.session.get_this_host(server.getSession()),
    2.37              keys)
    2.38      else:
    2.39          server.xend.node.send_debug_keys(keys)
    2.40 @@ -1715,7 +1716,7 @@ def xm_dmesg(args):
    2.41          usage('dmesg')
    2.42  
    2.43      if serverType == SERVER_XEN_API:
    2.44 -        host = server.xenapi.session.get_this_host()
    2.45 +        host = server.xenapi.session.get_this_host(server.getSession())
    2.46          if use_clear:
    2.47              print server.xenapi.host.dmesg_clear(host),
    2.48          else:
    2.49 @@ -1731,7 +1732,7 @@ def xm_log(args):
    2.50  
    2.51      if serverType == SERVER_XEN_API:
    2.52          print server.xenapi.host.get_log(
    2.53 -            server.xenapi.session.get_this_host())
    2.54 +            server.xenapi.session.get_this_host(server.getSession()))
    2.55      else:
    2.56          print server.xend.node.log()
    2.57