ia64/xen-unstable

changeset 7177:7f42935cb4b0

Move the import for XendError, and use a bare import, not a from...import.
This should silence the error message when the program is terminated during
startup.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Oct 04 02:25:04 2005 +0100 (2005-10-04)
parents 0e1838de9db8
children 625c75a223fe
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Oct 04 02:21:28 2005 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Oct 04 02:25:04 2005 +0100
     1.3 @@ -30,9 +30,14 @@ from getopt import getopt
     1.4  import socket
     1.5  import warnings
     1.6  warnings.filterwarnings('ignore', category=FutureWarning)
     1.7 +
     1.8 +import xen.xend.XendError
     1.9 +
    1.10  from xen.xend import PrettyPrint
    1.11  from xen.xend import sxp
    1.12  from xen.xm.opts import *
    1.13 +
    1.14 +
    1.15  shorthelp = """Usage: xm <subcommand> [args]
    1.16      Control, list, and manipulate Xen guest instances
    1.17  
    1.18 @@ -687,7 +692,6 @@ def main(argv=sys.argv):
    1.19      args = argv[2:]
    1.20      if cmd:
    1.21          try:
    1.22 -            from xen.xend.XendClient import XendError
    1.23              rc = cmd(args)
    1.24              if rc:
    1.25                  usage()
    1.26 @@ -698,7 +702,7 @@ def main(argv=sys.argv):
    1.27          except IOError:
    1.28              err("Most commands need root access.  Please try again as root")
    1.29              sys.exit(1)
    1.30 -        except XendError, ex:
    1.31 +        except xen.xend.XendError.XendError, ex:
    1.32              if len(args) > 0:
    1.33                  handle_xend_error(argv[1], args[0], ex)
    1.34              else:
    1.35 @@ -719,6 +723,3 @@ def main(argv=sys.argv):
    1.36  
    1.37  if __name__ == "__main__":
    1.38      main()
    1.39 -
    1.40 -
    1.41 -