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] [XENAPI] Make test script attempt to logi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XENAPI] Make test script attempt to login with blank credentials
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Jan 2007 08:55:31 -0800
Delivery-date: Thu, 25 Jan 2007 09:50:30 -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 Alastair Tse <atse@xxxxxxxxxxxxx>
# Date 1169653946 0
# Node ID f9eceb9c52d727dc49cd03c92668dcdc62459a19
# Parent  e4d415692ba5994b20a6833bbc609c69975beffc
[XENAPI] Make test script attempt to login with blank credentials
before prompting for passwords.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/scripts/xapi.py |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff -r e4d415692ba5 -r f9eceb9c52d7 tools/python/scripts/xapi.py
--- a/tools/python/scripts/xapi.py      Wed Jan 24 15:50:58 2007 +0000
+++ b/tools/python/scripts/xapi.py      Wed Jan 24 15:52:26 2007 +0000
@@ -170,12 +170,21 @@ _session = None
 _session = None
 def connect(*args):
     global _server, _session, _initialised
+    
     if not _initialised:
-        _server = ServerProxy('http://localhost:9363/')
-        login = raw_input("Login: ")
-        password = getpass()
-        creds = (login, password)
-        _session = execute(_server.session, 'login_with_password', creds)
+        # try without password
+        try:
+            _server = ServerProxy('http://localhost:9363/')
+            _session = execute(_server.session, 'login_with_password',
+                               ('',''))
+        except:
+            login = raw_input("Login: ")
+            password = getpass()
+            creds = (login, password)            
+            _server = ServerProxy('http://localhost:9363/')
+            _session = execute(_server.session, 'login_with_password',
+                               creds)
+
         _initialised = True
     return (_server, _session)
 
@@ -476,6 +485,15 @@ def xapi_vbd_list(args, async = False):
     for vbd in vbds:
         vbd_struct = execute(server, 'VBD.get_record', (session, vbd))
         print VBD_LIST_FORMAT % vbd_struct
+
+def xapi_vbd_stats(args, async = False):
+    server, session = connect()
+    domname = args[0]
+    dom_uuid = resolve_vm(server, session, domname)
+
+    vbds = execute(server, 'VM.get_VBDs', (session, dom_uuid))
+    for vbd_uuid in vbds:
+        print execute(server, 'VBD.get_io_read_kbs', (session, vbd_uuid))
  
 def xapi_vif_list(args, async = False):
     server, session = connect()

_______________________________________________
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] [XENAPI] Make test script attempt to login with blank credentials, Xen patchbot-unstable <=