Skip to contentSkip to conversation

Fix help option of xm create

RFC PATCH In review Masaki Kanno 2 participants 2 messages Sep 21, 2006 – Sep 22, 2006

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Fix help option of xm create

Hi,

I found strange behaviors and messages when tested the following commands.
- xm create --help [config file]
- xm create --help_config [config file]
- xm help create

<cf.>

# xm create --help
Usage:  create [options] [vars]

Create a domain
(snip)
addresses for virtual network interfaces. This must be a unique value across the entire cluster.

Error: Cannot open config file "xmdefconfig"

# xm create --help /xen/vm1.conf 
Usage:  create [options] [vars]

Create a domain.
(snip)
addresses for virtual network interfaces. This must be a unique value across the entire cluster.

Using config file "/xen/vm1.conf".
The following are automically imported:
import sys
import os
import os.path
from xen.util.ip import *

# xm create --help_config /xen/vm1.conf 
Using config file "/xen/vm1.conf".
The following are automically imported:
    import sys
    import os
    import os.path
    from xen.util.ip import *
# xm help create
Usage:  create [options] [vars]

Create a domain.
(snip)
addresses for virtual network interfaces. This must be a unique value across the entire cluster.

Error: Cannot open config file "xmdefconfig"

I made this patch not to display these messages. But I'm wondering whether my approach is right, and the "/etc/xen/xmdefconfig" should be created to solve this problem.

I need any comments about this matter or reason why the help_config option's behavior.

Best regards,
Kan

tools/python/xen/xm/create.py +0 -2
diff -r d8bceca5f07d tools/python/xen/xm/create.py
@@ -1022,8 +1022,6 @@ def parseCommandLine(argv):
     if gopts.vals.help:
         gopts.usage()
     if gopts.vals.help or gopts.vals.help_config:
-        gopts.load_defconfig(help=1)
-    if gopts.vals.help or gopts.vals.help_config:
         return (None, None)
 
     if not gopts.vals.display:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 7 lines · Masaki Kanno

Hi,

I found strange behaviors and messages when tested the following commands.
- xm create --help [config file]
- xm create --help_config [config file]
- xm help create

[snip..]

Hi,

I put in a patch to fix the --help_config problem after my option parsing error handling clean up. You're right that it shouldn't be trying to load anything if --help_config is specified.

Thanks,

Alastair