Some better handling

This commit is contained in:
2018-06-10 20:21:00 -04:00
parent dec88f6c1a
commit 6fd2508ff6
2 changed files with 25 additions and 10 deletions

15
pvc.py
View File

@@ -573,6 +573,20 @@ def search(dom_name, dom_uuid, long_output):
pvcf.stopZKConnection(zk)
###############################################################################
# pvc list
###############################################################################
@click.command(name='vlist', short_help='List all VM objects')
def vlist():
"""
List all virtual machines in the cluster.
"""
zk = pvcf.startZKConnection(zk_host)
for vm in zk.get_children('/domains'):
print(vm)
###############################################################################
# pvc init
###############################################################################
@@ -643,6 +657,7 @@ vm.add_command(unmigrate_vm)
cli.add_command(node)
cli.add_command(vm)
cli.add_command(search)
cli.add_command(vlist)
cli.add_command(init_cluster)
#