# Buggy code
def info(name):
    """
    .. versionadded:: 2015.8.4

    Return the gluster volume info.

    name
        Volume name

    CLI Example:

    .. code-block:: bash

        salt '*' glusterfs.info myvolume

    """
    cmd = "volume info {0}".format(name)
    root = _gluster_xml(cmd)

    volume = [x for x in _iter(root, "volume")][0]

    ret = {name: _etree_to_dict(volume)}

    bricks = {}
    for i, brick in enumerate(_iter(volume, "brick"), start=1):
        brickkey = "brick{0}".format(i)
        bricks[brickkey] = {"path": brick.text}
        for child in brick.getchildren():
            if not child.tag == "name":
                bricks[brickkey].update({child.tag: child.text})
        for k, v in brick.items():
            bricks[brickkey][k] = v
    ret[name]["bricks"] = bricks

    options = {}
    for option in _iter(volume, "option"):
        options[option.find("name").text] = option.find("value").text
    ret[name]["options"] = options

    return ret


# Traceback (TypeError)
2016-02-05 10:07:01,763 [salt.state       ][INFO    ][25335] Running state [10.129.2.33] at time 10:07:01.762913
2016-02-05 10:07:01,763 [salt.state       ][INFO    ][25335] Executing state glusterfs.peered for 10.129.2.33 <-- This is the primary glusterfs host
2016-02-05 10:07:01,764 [salt.loaded.int.module.cmdmod][INFO    ][25335] Executing command 'gluster --xml --mode=script' in directory '/root'
2016-02-05 10:07:01,871 [salt.loaded.int.module.cmdmod][INFO    ][25335] Executing command 'gluster --xml --mode=script' in directory '/root'
2016-02-05 10:07:01,964 [salt.loaded.int.module.cmdmod][INFO    ][25335] Executing command 'gluster --xml --mode=script' in directory '/root'
2016-02-05 10:07:02,057 [salt.state       ][ERROR   ][25335] An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/glusterfs.py", line 83, in peered
elif 'on localhost not needed' in ret['comment']:
TypeError: argument of type 'bool' is not iterable

# Fixed code
def info(name):
    """
    .. versionadded:: 2015.8.4

    Return the gluster volume info.

    name
        Volume name

    CLI Example:

    .. code-block:: bash

        salt '*' glusterfs.info myvolume

    """
    cmd = "volume info {0}".format(name)
    root = _gluster_xml(cmd)

    volume = [x for x in _iter(root, "volume")][0]

    ret = {name: _etree_to_dict(volume)}

    bricks = {}
    for i, brick in enumerate(_iter(volume, "brick"), start=1):
        brickkey = "brick{0}".format(i)
        bricks[brickkey] = {"path": brick.text}
        for child in list(brick):
            if not child.tag == "name":
                bricks[brickkey].update({child.tag: child.text})
        for k, v in brick.items():
            bricks[brickkey][k] = v
    ret[name]["bricks"] = bricks

    options = {}
    for option in _iter(volume, "option"):
        options[option.find("name").text] = option.find("value").text
    ret[name]["options"] = options

    return ret