WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Allow the XenAPI Session object to have l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Allow the XenAPI Session object to have login_with_password called as a
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Dec 2006 09:14:06 -0800
Delivery-date: Sat, 16 Dec 2006 09:33:01 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1166203082 0
# Node ID 9fd958cc51224b4890ad10c51f635ac81b1b8d35
# Parent  040093fa1f9ec6bb132afa33703a36f12f10e099
Allow the XenAPI Session object to have login_with_password called as a
methodname, to re-login through the same object (say when the server is
restarted).

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/XenAPI.py |    8 ++++++--
 tools/python/xen/xm/main.py   |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff -r 040093fa1f9e -r 9fd958cc5122 tools/python/xen/xm/XenAPI.py
--- a/tools/python/xen/xm/XenAPI.py     Fri Dec 15 17:33:31 2006 +0000
+++ b/tools/python/xen/xm/XenAPI.py     Fri Dec 15 17:18:02 2006 +0000
@@ -83,8 +83,12 @@ class Session(xen.util.xmlrpclib2.Server
 
 
     def xenapi_request(self, methodname, params):
-        full_params = (self._session,) + params
-        return _parse_result(getattr(self, methodname)(*full_params))
+        if methodname.startswith('login'):
+            self._login(methodname, *params)
+            return None
+        else:
+            full_params = (self._session,) + params
+            return _parse_result(getattr(self, methodname)(*full_params))
 
 
     def _login(self, method, username, password):
diff -r 040093fa1f9e -r 9fd958cc5122 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Fri Dec 15 17:33:31 2006 +0000
+++ b/tools/python/xen/xm/main.py       Fri Dec 15 17:18:02 2006 +0000
@@ -558,7 +558,7 @@ class Shell(cmd.Cmd):
                 ok, res = _run_cmd(lambda x: server.xenapi_request(words[0],
                                                                    tuple(x)),
                                    words[0], words[1:])
-                if ok and res != '':
+                if ok and res is not None and res != '':
                     pprint.pprint(res)
             else:
                 print '*** Unknown command: %s' % words[0]

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Allow the XenAPI Session object to have login_with_password called as a, Xen patchbot-unstable <=