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-devel

[Xen-devel] [PATCH 4/4] Add support for XM_SERVER variable to choose XML

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 4/4] Add support for XM_SERVER variable to choose XML-RPC URI
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Wed, 14 Jun 2006 14:34:56 -0500
Cc: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Delivery-date: Wed, 14 Jun 2006 12:35:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <44906357.90107@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <44906357.90107@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (X11/20060612)
Repost of earlier patch.

Regards,

Anthony Liguori
# HG changeset patch
# User anthony@xxxxxxxxxxxxxxxxxxxxx
# Node ID f8fcaee58fc1f7e13ae8443336a80de4c4e50538
# Parent  03bbc156d3e8fb01eee2af990176bb64e012c4e1
Use an environmental variable (XM_SERVER) to determine XML-RPC URI.

This allows users to invoke xm against a remote server.  This is much more
useful though for exercising XML-RPC transports with xm-test though since
xm-test will continue to (mostly) function if the URI is localhost.

Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

diff -r 03bbc156d3e8 -r f8fcaee58fc1 tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       Sat Jun 10 19:16:33 2006
+++ b/tools/python/xen/xend/XendClient.py       Sat Jun 10 19:19:02 2006
@@ -18,6 +18,7 @@
 #============================================================================
 
 from xen.util.xmlrpclib2 import ServerProxy
+import os
 
 XML_RPC_SOCKET = "/var/run/xend/xmlrpc.sock"
 
@@ -25,4 +26,8 @@
 ERROR_GENERIC = 2
 ERROR_INVALID_DOMAIN = 3
 
-server = ServerProxy('httpu:///var/run/xend/xmlrpc.sock')
+uri = 'httpu:///var/run/xend/xmlrpc.sock'
+if os.environ.has_key('XM_SERVER'):
+    uri = os.environ['XM_SERVER']
+
+server = ServerProxy(uri)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel