Mailing List Archive

Issue diagnostics if xm is being run as a non-root user. This used to happen,
# HG changeset patch
# User emellor@ewan
# Node ID 1d8933fa01d27352f17ba489205595cf56babf3a
# Parent e89a7279d6023e12b21720f737309606413e0336
Issue diagnostics if xm is being run as a non-root user. This used to happen,
but the triggering error has moved, so the diagnostics were broken.

Signed-off-by: Ewan Mellor <ewan@xensource.com>

diff -r e89a7279d602 -r 1d8933fa01d2 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Wed Oct 12 08:34:27 2005
+++ b/tools/python/xen/xm/main.py Wed Oct 12 09:07:04 2005
@@ -688,11 +688,16 @@
if rc:
usage()
except socket.error, ex:
- print >>sys.stderr, ex
- err("Error connecting to xend, is xend running?")
+ if os.geteuid() != 0:
+ err("Most commands need root access. Please try again as root.")
+ else:
+ err("Error connecting to xend: %s. Is xend running?" % ex[1])
sys.exit(1)
except IOError:
- err("Most commands need root access. Please try again as root")
+ if os.geteuid() != 0:
+ err("Most commands need root access. Please try again as root.")
+ else:
+ err("Error connecting to xend: %s." % ex[1])
sys.exit(1)
except xen.xend.XendError.XendError, ex:
if len(args) > 0:

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