mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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>
This commit is contained in:
1 parent
e8d5405d57
commit
2543c86b2a
1 file changed
+8
-3
@@ -688,11 +688,16 @@ def main(argv=sys.argv):
|
||||
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:
|
||||
|
||||