Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Factor out the parsing of XAUTHORITY, so that it can be

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Factor out the parsing of XAUTHORITY, so that it can be used by the unit test,
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Apr 2006 13:40:08 +0000
Delivery-date: Fri, 07 Apr 2006 06:40:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 9fcfdab04aa931865de059f3826c91e1a140a127
# Parent  edeeddb1bbf9e4f5ac5f600cbf4aac8aafec9007
Factor out the parsing of XAUTHORITY, so that it can be used by the unit test,
and fix that test to use it.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r edeeddb1bbf9 -r 9fcfdab04aa9 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Thu Apr  6 13:21:45 2006
+++ b/tools/python/xen/xm/create.py     Thu Apr  6 13:22:52 2006
@@ -850,6 +850,18 @@
     opts.info("Started domain %s" % (dom))
     return int(sxp.child_value(dominfo, 'domid'))
 
+
+def get_xauthority():
+    xauth = os.getenv("XAUTHORITY")
+    if not xauth:
+        home = os.getenv("HOME")
+        if not home:
+            import posix, pwd
+            home = pwd.getpwuid(posix.getuid())[5]
+        xauth = home + "/.Xauthority"
+    return xauth
+
+
 def parseCommandLine(argv):
     gopts.reset()
     args = gopts.parse(argv)
@@ -864,14 +876,7 @@
         gopts.vals.display = os.getenv("DISPLAY")
 
     if not gopts.vals.xauthority:
-        xauth = os.getenv("XAUTHORITY")
-        if not xauth:
-            home = os.getenv("HOME")
-            if not home:
-                import posix, pwd
-                home = pwd.getpwuid(posix.getuid())[5]
-            xauth = home + "/.Xauthority"
-        gopts.vals.xauthority = xauth
+        gopts.vals.xauthority = get_xauthority()
 
     # Process remaining args as config variables.
     for arg in args:
diff -r edeeddb1bbf9 -r 9fcfdab04aa9 tools/python/xen/xm/tests/test_create.py
--- a/tools/python/xen/xm/tests/test_create.py  Thu Apr  6 13:21:45 2006
+++ b/tools/python/xen/xm/tests/test_create.py  Thu Apr  6 13:22:52 2006
@@ -51,6 +51,7 @@
                  'path'      : '.:/etc/xen',
                  'builder'   : 'linux',
                  'nics'      : -1,
+                 'xauthority': xen.xm.create.get_xauthority(),
                  })
 
 
@@ -99,6 +100,8 @@
                  'interface'   : 'eth0',
                  'path'        : '.:/etc/xen',
                  'builder'     : 'linux',
+
+                 'xauthority'  : xen.xm.create.get_xauthority(),
                })
 
 
@@ -138,6 +141,8 @@
                  'path'       : '.:/etc/xen',
                  'builder'    : 'linux',
                  'nics'       : -1,
+
+                 'xauthority' : xen.xm.create.get_xauthority(),
                  })
             
 
@@ -188,6 +193,8 @@
                  'dhcp'        : 'off',
                  'interface'   : 'eth0',
                  'path'        : '.:/etc/xen',
+
+                 'xauthority'  : xen.xm.create.get_xauthority(),
                })
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Factor out the parsing of XAUTHORITY, so that it can be used by the unit test,, Xen patchbot -unstable <=