[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Use an environmental variable (XM_SERVER) to determine XML-RPC URI.



# HG changeset patch
# User anthony@xxxxxxxxxxxxxxxxxxxxx
# Node ID 1297dc3153088f625b477f7f00a78347591e40f4
# Parent  c2cbcccc44f4252e85ab361f5abbcbe3f3cb3007
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>
---
 tools/python/xen/xend/XendClient.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -r c2cbcccc44f4 -r 1297dc315308 tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       Tue Jun 20 10:25:21 2006 +0100
+++ b/tools/python/xen/xend/XendClient.py       Tue Jun 20 10:25:22 2006 +0100
@@ -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_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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.