'swift-ring-builder <builder_file> list_parts <search-value> [<search-value>] ..
or
swift-ring-builder <builder_file> list_parts
--region <region> --zone <zone> --ip <ip or hostname> --port <port>
--replication-ip <r_ip or r_hostname> --replication-port <r_port>
--device <device_name> --meta <meta> --weight <weight>
Where <r_ip>, <r_hostname> and <r_port> are replication ip, hostname
and port.
Any of the options are optional in both cases.
Returns a 2 column list of all the partitions that are assigned to any of
the devices matching the search values given. The first column is the
assigned partition number and the second column is the number of device
matches for that partition. The list is ordered from most number of matches
to least. If there are a lot of devices to match against, this command
could take a while to run.'

@staticmethod
def list_parts():

    if (len(argv) < 4):
        print(Commands.list_parts.__doc__.strip())
        print()
        print(parse_search_value.__doc__.strip())
        exit(EXIT_ERROR)
    if (not builder._replica2part2dev):
        print(('Specified    builder    file    "%s"    is    not    rebalanced    yet.    Please    rebalance    first.' % builder_file))
        exit(EXIT_ERROR)
    devs = _parse_list_parts_values(argv[3:])
    if (not devs):
        print('No    matching    devices    found')
        exit(EXIT_ERROR)
    sorted_partition_count = _find_parts(devs)
    if (not sorted_partition_count):
        print('No    matching    devices    found')
        exit(EXIT_ERROR)
    print('Partition            Matches')
    for (partition, count) in sorted_partition_count:
        print(('%9d            %7d' % (partition, count)))
    exit(EXIT_SUCCESS)
