qvm-tools: add qvm-ls --raw-list for machine readable VM list
This commit is contained in:
parent
cce5210239
commit
cd6504f8ea
@ -121,6 +121,10 @@ def main():
|
||||
action="store_true", default=False,
|
||||
help="Show date of last VM backup")
|
||||
|
||||
parser.add_option("--raw-list", dest="raw_list",
|
||||
action="store_true", default=False,
|
||||
help="List only VM names one per line")
|
||||
|
||||
|
||||
(options, args) = parser.parse_args ()
|
||||
|
||||
@ -129,6 +133,11 @@ def main():
|
||||
qvm_collection.load()
|
||||
qvm_collection.unlock_db()
|
||||
|
||||
if options.raw_list:
|
||||
for vm in qvm_collection.values():
|
||||
print vm.name
|
||||
return
|
||||
|
||||
fields_to_display = ["name", "on", "state", "updbl", "type", "template", "netvm", "label" ]
|
||||
|
||||
cpu_usages = None
|
||||
|
Loading…
Reference in New Issue
Block a user