def _hgetall(duthost, db, key):
    """Run Redis command hgetall over db on duthost."""
    command = "redis-cli --raw -n {db} hgetall '{key}'".format(db=db, key=key)
    lines = duthost.shell(command)["stdout_lines"]
    return {lines[i]: lines[i + 1] for i in range(0, len(lines), 2)}