ia64/xen-unstable

changeset 1574:76f6b7403b15

bitkeeper revision 1.1010.1.3 (40db2385Aq2phajZDogkMkJtQna8qA)

Some small help fixes.
author mjw@wray-m-3.hpl.hp.com
date Thu Jun 24 18:55:01 2004 +0000 (2004-06-24)
parents d54973432d60
children 15a31950e646
files tools/xenmgr/lib/xm/main.py tools/xenmgr/lib/xm/shutdown.py
line diff
     1.1 --- a/tools/xenmgr/lib/xm/main.py	Thu Jun 24 15:44:04 2004 +0000
     1.2 +++ b/tools/xenmgr/lib/xm/main.py	Thu Jun 24 18:55:01 2004 +0000
     1.3 @@ -127,7 +127,7 @@ class ProgHelp(Prog):
     1.4              name = args[1]
     1.5              p = self.xm.getprog(name)
     1.6              if p:
     1.7 -                p.help(args)
     1.8 +                p.help(args[1:])
     1.9              else:
    1.10                  print '%s: Unknown command: %s' % (self.name, name)
    1.11          else:
    1.12 @@ -159,22 +159,13 @@ class ProgSave(Prog):
    1.13      info = """Save domain state (and config) to file."""
    1.14  
    1.15      def help(self, args):
    1.16 -        print args[0], "DOM FILE [CONFIG]"
    1.17 -        print """\nSave domain with id DOM to FILE.
    1.18 -        Optionally save config to CONFIG."""
    1.19 +        print args[0], "DOM FILE"
    1.20 +        print """\nSave domain with id DOM to FILE."""
    1.21          
    1.22      def main(self, args):
    1.23          if len(args) < 3: self.err("%s: Missing arguments" % args[0])
    1.24          dom = args[1]
    1.25          savefile = os.path.abspath(args[2])
    1.26 -        configfile = None
    1.27 -        if len(args) == 4:
    1.28 -            configfile = os.path.abspath(args[3])
    1.29 -        if configfile:
    1.30 -            out = file(configfile, 'w')
    1.31 -            config = server.xend_domain(dom)
    1.32 -            PrettyPrint.prettyprint(config, out=out)
    1.33 -            out.close()
    1.34          server.xend_domain_save(dom, savefile)
    1.35  
    1.36  xm.prog(ProgSave)
    1.37 @@ -185,13 +176,16 @@ class ProgRestore(Prog):
    1.38      info = """Create a domain from a saved state."""
    1.39  
    1.40      def help(self, args):
    1.41 -        print args[0], "FILE CONFIG"
    1.42 +        print args[0], "FILE [CONFIG]"
    1.43          print "\nRestore a domain from FILE using configuration CONFIG."
    1.44      
    1.45      def main(self, help, args):
    1.46 -        if len(args) < 3: self.err("%s: Missing arguments" % args[0])
    1.47 +        if len(args) < 2: self.err("%s: Missing arguments" % args[0])
    1.48          savefile =  os.path.abspath(args[1])
    1.49 -        configfile = os.path.abspath(args[2])
    1.50 +        if len(args) >= 3:
    1.51 +            configfile = os.path.abspath(args[2])
    1.52 +        else:
    1.53 +            configfile = None
    1.54          info = server.xend_domain_restore(savefile, configfile)
    1.55          PrettyPrint.prettyprint(info)
    1.56  
     2.1 --- a/tools/xenmgr/lib/xm/shutdown.py	Thu Jun 24 15:44:04 2004 +0000
     2.2 +++ b/tools/xenmgr/lib/xm/shutdown.py	Thu Jun 24 18:55:01 2004 +0000
     2.3 @@ -64,7 +64,7 @@ def main_dom(opts, args):
     2.4  def main(argv):
     2.5      opts = gopts
     2.6      args = opts.parse(argv)
     2.7 -    if opts.help:
     2.8 +    if opts.vals.help:
     2.9          opts.usage()
    2.10          return
    2.11      print 'shutdown.main>', len(args), args