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:
emellor@ewan committed 2005-10-12 10:07:04 +01:00
1 parent e8d5405d57
commit 2543c86b2a
1 file changed
+8 -3
+8 -3
View File
@@ -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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.