From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH 3/3] Let xm user choose XML-RPC URI Date: Sat, 10 Jun 2006 14:39:45 -0500 Message-ID: <448B2001.1070203@us.ibm.com> References: <448B1EF2.5050801@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000906090400080407070406" Return-path: In-Reply-To: <448B1EF2.5050801@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel Cc: Ewan Mellor List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000906090400080407070406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch let's a user (via the XM_SERVER environment variable) choose which XML-RPC URI is used within xm. Regards, Anthony Liguori --------------000906090400080407070406 Content-Type: text/plain; name="xm_server.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xm_server.diff" # HG changeset patch # User anthony@rhesis.austin.ibm.com # 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 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) --------------000906090400080407070406 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000906090400080407070406--