def main():
    """ Ansible module main method. """
    module = AnsibleModule(
        argument_spec=dict(
            disks=dict(required=True, type='str'),
            force=dict(required=False, default="no", type='bool'),
            sizes=dict(required=True, type='str')
        ),
        supports_check_mode=True,
    )

    disks = module.params['disks']
    force = module.params['force']
    if force is None:
        force = False
    sizes = module.params['sizes']

    try:
        specs = parse_spec(sizes)
    except ValueError, ex:
        err = "Error parsing sizes=" + sizes + ": " + str(ex)
        module.fail_json(msg=err)

    partitions = []
    changed_count = 0
    for disk in disks.split(","):
        try:
            changed_count += partition(disk, specs, force, module.check_mode)
        except Exception, ex:
            err = "Error creating partitions on " + disk + ": " + str(ex)
            raise
            #module.fail_json(msg=err)
        partitions += get_partitions(disk)

    module.exit_json(changed=(changed_count > 0), ansible_facts={"partition_pool": partitions})

# ignore pylint errors related to the module_utils import
# pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import
# import module snippets
dataset/ETHPy150Open openshift/openshift-ansible/roles/kube_nfs_volumes/library/partitionpool.py/main/original