From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH 4/4] Add support for XM_SERVER variable to choose XML-RPC URI Date: Wed, 14 Jun 2006 14:34:56 -0500 Message-ID: <449064E0.3030308@us.ibm.com> References: <44906357.90107@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010705000609090704080407" Return-path: In-Reply-To: <44906357.90107@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. --------------010705000609090704080407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Repost of earlier patch. Regards, Anthony Liguori --------------010705000609090704080407 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) --------------010705000609090704080407 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 --------------010705000609090704080407--