def _json_format_dict(data, pretty=False):

    if pretty:
        return json.dumps(data, sort_keys=True, indent=2)
    else:
        return json.dumps(data)
Check the length of specified string
dataset/ETHPy150Open openshift/openshift-ansible/inventory/libvirt/hosts/libvirt_generic.py/_json_format_dict--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/utils.py/check_string_length