parser = OptionParser(usage="sfi [sfi_options] %s [options] %s" \
% (command, cmdargs[command]))
- # This option is for all commands
- parser.add_option("-x", "--dumpformat", dest="dumpformat", type="choice",
- help="dump format (text|xml)",default="text",
- choices=("text","xml"))
-
if command in ("resources"):
parser.add_option("-f", "--format", dest="format",type="choice",
help="display format (dns|ip|rspec)",default="rspec",
- choices=("dns","ip","rspec"))
+ choices=("dns","ip","xml"))
if command in ("list", "show", "remove"):
parser.add_option("-t", "--type", dest="type",type="choice",
help="type filter (user|slice|sa|ma|node|aggregate)",
choices=("user","slice","sa","ma","node","aggregate", "all"),
default="all")
if command in ("show", "list", "resources"):
+ # This option is for all commands
+ parser.add_option("-f", "--format", dest="format", type="choice",
+ help="display format (text|xml)",default="text",
+ choices=("text","xml"))
parser.add_option("-o", "--output", dest="file",
help="output XML to file", metavar="FILE", default=None)
if command in ("delegate"):
else:
record = GeniRecord(dict = record)
- if (opts.dumpformat=="text"):
+ if (opts.format=="text"):
record.dump()
else:
print record.save_to_string()