# Buggy code
def get(zpool, prop=None, show_source=False, parsable=True):
    """
    .. versionadded:: 2016.3.0

    Retrieves the given list of properties

    zpool : string
        Name of storage pool

    prop : string
        Optional name of property to retrieve

    show_source : boolean
        Show source of property

    parsable : boolean
        Display numbers in parsable (exact) values

        .. versionadded:: 2018.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.get myzpool

    """
    ret = OrderedDict()
    value_properties = ["property", "value", "source"]

    ## collect get output
    res = __salt__["cmd.run_all"](
        __utils__["zfs.zpool_command"](
            command="get",
            flags=["-H", "-p"],
            opts={"-o": ",".join(value_properties)},
            property_name=prop if prop else "all",
            target=zpool,
        ),
        python_shell=False,
    )

    if res["retcode"] != 0:
        return __utils__["zfs.parse_command_result"](res)

    # NOTE: command output for reference
    # ========================================================================
    # ...
    # data  mountpoint  /data   local
    # data  compression off     default
    # ...
    # =========================================================================

    # parse get output
    for line in res["stdout"].splitlines():
        # NOTE: transform data into dict
        prop_data = OrderedDict(
            list(
                zip(
                    value_properties,
                    [x for x in line.strip().split("\t") if x not in [""]],
                )
            )
        )

        # NOTE: normalize values
        if parsable:
            # NOTE: raw numbers and pythonic types
            prop_data["value"] = __utils__["zfs.from_auto"](
                prop_data["property"], prop_data["value"]
            )
        else:
            # NOTE: human readable zfs types
            prop_data["value"] = __utils__["zfs.to_auto"](
                prop_data["property"], prop_data["value"]
            )

        # NOTE: show source if requested
        if show_source:
            ret[prop_data["property"]] = prop_data
            del ret[prop_data["property"]]["property"]
        else:
            ret[prop_data["property"]] = prop_data["value"]

    return ret


# Traceback (IndexError)
# salt-call saltutil.sync_all
[ERROR   ] Command '/sbin/zpool list -H -p -o name,size' failed with return code: 2
[ERROR   ] output: invalid option 'p'
usage:
list [-gHLPv] [-o property[,...]] [-T d|u] [pool] ... [interval [count]]
...

[CRITICAL] Failed to load grains defined in grain file zfs.zfs in function <function zfs at 0x7fa3241bf2a8>, error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 756, in grains
ret = funcs[key]()
File "/usr/lib/python2.7/dist-packages/salt/grains/zfs.py", line 116, in zfs
grains = salt.utils.dictupdate.update(grains, _zfs_pool_data(), merge_lists=True)
File "/usr/lib/python2.7/dist-packages/salt/grains/zfs.py", line 102, in _zfs_pool_data
grains['zpool'][zpool[0]] = _conform_value(zpool[1], True)
IndexError: list index out of range
...

# Fixed code
def get(zpool, prop=None, show_source=False, parsable=True):
    """
    .. versionadded:: 2016.3.0

    Retrieves the given list of properties

    zpool : string
        Name of storage pool

    prop : string
        Optional name of property to retrieve

    show_source : boolean
        Show source of property

    parsable : boolean
        Display numbers in parsable (exact) values

        .. versionadded:: 2018.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' zpool.get myzpool

    """
    ret = OrderedDict()
    value_properties = ["property", "value", "source"]

    ## collect get output
    res = __salt__["cmd.run_all"](
        __utils__["zfs.zpool_command"](
            command="get",
            flags=["-H"],
            opts={"-o": ",".join(value_properties)},
            property_name=prop if prop else "all",
            target=zpool,
        ),
        python_shell=False,
    )

    if res["retcode"] != 0:
        return __utils__["zfs.parse_command_result"](res)

    # NOTE: command output for reference
    # ========================================================================
    # ...
    # data  mountpoint  /data   local
    # data  compression off     default
    # ...
    # =========================================================================

    # parse get output
    for line in res["stdout"].splitlines():
        # NOTE: transform data into dict
        prop_data = OrderedDict(
            list(
                zip(
                    value_properties,
                    [x for x in line.strip().split("\t") if x not in [""]],
                )
            )
        )

        # NOTE: normalize values
        if parsable:
            # NOTE: raw numbers and pythonic types
            prop_data["value"] = __utils__["zfs.from_auto"](
                prop_data["property"], prop_data["value"]
            )
        else:
            # NOTE: human readable zfs types
            prop_data["value"] = __utils__["zfs.to_auto"](
                prop_data["property"], prop_data["value"]
            )

        # NOTE: show source if requested
        if show_source:
            ret[prop_data["property"]] = prop_data
            del ret[prop_data["property"]]["property"]
        else:
            ret[prop_data["property"]] = prop_data["value"]

    return ret