# Buggy code
def _get_permissions(self):
    perms_out = [
        perm
        for perm in self._exec(["list_user_permissions", self.username], True)
        if perm.strip()
    ]

    perms_list = list()
    for perm in perms_out:
        vhost, configure_priv, write_priv, read_priv = perm.split("\t")
        if not self.bulk_permissions:
            if vhost == self.permissions[0]["vhost"]:
                perms_list.append(
                    dict(
                        vhost=vhost,
                        configure_priv=configure_priv,
                        write_priv=write_priv,
                        read_priv=read_priv,
                    )
                )
                break
        else:
            perms_list.append(
                dict(
                    vhost=vhost,
                    configure_priv=configure_priv,
                    write_priv=write_priv,
                    read_priv=read_priv,
                )
            )
    return perms_list


# Traceback (TypeError)
Traceback (most recent call last):
File \"/home/user/.ansible/tmp/ansible-tmp-1543222268.31-229234673963142/AnsiballZ_rabbitmq_user.py\", line 261, in <module>
_ansiballz_main()
File \"/home/user/.ansible/tmp/ansible-tmp-1543222268.31-229234673963142/AnsiballZ_rabbitmq_user.py\", line 251, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File \"/home/user/.ansible/tmp/ansible-tmp-1543222268.31-229234673963142/AnsiballZ_rabbitmq_user.py\", line 119, in invoke_module
imp.load_module('__main__', mod, module, MOD_DESC)
File \"/usr/lib/python3.6/imp.py\", line 235, in load_module
return load_source(name, filename, file)
File \"/usr/lib/python3.6/imp.py\", line 170, in load_source
module = _exec(spec, sys.modules[name])
File \"<frozen importlib._bootstrap>\", line 618, in _exec
File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module
File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed
File \"/tmp/ansible_rabbitmq_user_payload_yjcxsat6/__main__.py\", line 317, in <module>
File \"/tmp/ansible_rabbitmq_user_payload_yjcxsat6/__main__.py\", line 304, in main
File \"/tmp/ansible_rabbitmq_user_payload_yjcxsat6/__main__.py\", line 233, in has_permissions_modifications
TypeError: '<' not supported between instances of 'dict' and 'dict'

# Fixed code
def _get_permissions(self):
    """Get permissions of the user from RabbitMQ."""
    perms_out = [
        perm
        for perm in self._exec(["list_user_permissions", self.username], True)
        if perm.strip()
    ]

    perms_list = list()
    for perm in perms_out:
        vhost, configure_priv, write_priv, read_priv = perm.split("\t")
        if not self.bulk_permissions:
            if vhost == self.permissions[0]["vhost"]:
                perms_list.append(
                    dict(
                        vhost=vhost,
                        configure_priv=configure_priv,
                        write_priv=write_priv,
                        read_priv=read_priv,
                    )
                )
                break
        else:
            perms_list.append(
                dict(
                    vhost=vhost,
                    configure_priv=configure_priv,
                    write_priv=write_priv,
                    read_priv=read_priv,
                )
            )
    return perms_list