aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@hp.com>2007-10-01 13:59:37 -0600
committerAlex Williamson <alex.williamson@hp.com>2007-10-01 13:59:37 -0600
commit3c78b60b9459e40eb8d2eb93b19d461a4a82070c (patch)
tree581579663ae1b72422083814216fee6377e7c44b /tools
parentff051c2fbcb8dad706cbfa177dcaa960a71fc845 (diff)
parenteaaa8ec56109140638d9ebb368ee339960486209 (diff)
downloadxen-3c78b60b9459e40eb8d2eb93b19d461a4a82070c.tar.gz
xen-3c78b60b9459e40eb8d2eb93b19d461a4a82070c.tar.bz2
xen-3c78b60b9459e40eb8d2eb93b19d461a4a82070c.zip
merge with xen-unstable.hg
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xm/main.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index 25f7c4e1da..a546712b45 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -55,6 +55,9 @@ from xen.util.acmpolicy import ACM_LABEL_UNLABELED_DISPLAY
import XenAPI
+import inspect
+from xen.xend import XendOptions
+xoptions = XendOptions.instance()
# getopt.gnu_getopt is better, but only exists in Python 2.3+. Use
# getopt.getopt if gnu_getopt is not available. This will mean that options
@@ -1595,7 +1598,31 @@ def xm_sched_credit(args):
err(str(result))
def xm_info(args):
- arg_check(args, "info", 0)
+ arg_check(args, "info", 0, 1)
+
+ try:
+ (options, params) = getopt.gnu_getopt(args, 'c', ['config'])
+ except getopt.GetoptError, opterr:
+ err(opterr)
+ usage('info')
+
+ show_xend_config = 0
+ for (k, v) in options:
+ if k in ['-c', '--config']:
+ show_xend_config = 1
+
+ if show_xend_config:
+ for name, obj in inspect.getmembers(xoptions):
+ if not inspect.ismethod(obj):
+ if name == "config":
+ for x in obj[1:]:
+ if len(x) < 2:
+ print "%-38s: (none)" % x[0]
+ else:
+ print "%-38s:" % x[0], x[1]
+ else:
+ print "%-38s:" % name, obj
+ return
if serverType == SERVER_XEN_API: