From: anthony@rhesis.austin.ibm.com Date: Tue, 20 Jun 2006 09:25:22 +0000 (+0100) Subject: Use an environmental variable (XM_SERVER) to determine XML-RPC URI. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15921^2~22 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=22737f2517bf42a75ea0447dff8fdffc1fd49a6b;p=xen.git 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 --git a/tools/python/xen/xend/XendClient.py b/tools/python/xen/xend/XendClient.py index fb9974aa5a..62b3bfb403 100644 --- a/tools/python/xen/xend/XendClient.py +++ b/tools/python/xen/xend/XendClient.py @@ -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_INTERNAL = 1 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)