def print_datastore_info(ds_obj):
    summary = ds_obj.summary
    ds_capacity = summary.capacity
    ds_freespace = summary.freeSpace
    ds_uncommitted = summary.uncommitted if summary.uncommitted else 0
    ds_provisioned = ds_capacity - ds_freespace + ds_uncommitted
    ds_overp = ds_provisioned - ds_capacity
    ds_overp_pct = (ds_overp * 100) / ds_capacity \
        if ds_capacity else 0
    print ""
    print "Name                  : {}".format(summary.name)
    print "URL                   : {}".format(summary.url)
    print "Capacity              : {} GB".format(sizeof_fmt(ds_capacity))
    print "Free Space            : {} GB".format(sizeof_fmt(ds_freespace))
    print "Uncommitted           : {} GB".format(sizeof_fmt(ds_uncommitted))
    print "Provisioned           : {} GB".format(sizeof_fmt(ds_provisioned))
    if 0 > ds_overp:
        print "Over-provisioned      : {} GB / {} %".format(
            sizeof_fmt(ds_overp),
            ds_overp_pct)
    print "Hosts                 : {}".format(len(ds_obj.host))
    print "Virtual Machines      : {}".format(len(ds_obj.vm))
dataset/ETHPy150Open vmware/pyvmomi-community-samples/samples/list_dc_datastore_info.py/print_datastore_info/swapped operands of `>`