Skip to content

Commit

Permalink
Changes to thelookup template to encounter tox-ansible sanity check f…
Browse files Browse the repository at this point in the history
…ailures (#344)
  • Loading branch information
abhikdps authored Dec 19, 2024
1 parent 99f6a25 commit ff8705e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{# lookup_plugin_template.j2 #}
{%- set lookup_name = plugin_name | default("hello_world") -%}
{%- set author = author | default("Your Name") -%}
{%- set author = author | default("Your Name (@username)") -%}
{%- set description = description | default("A custom lookup plugin for Ansible.") -%}
{%- set license = license | default("GPL-3.0-or-later") -%}
"""An example lookup plugin file."""
# {{ lookup_name }}.py - {{ description }}

# pylint: disable=E0401
# {{ lookup_name }}.py - {{ description }}
# Author: {{ author }}
# License: {{ license }}

from typing import Any, Optional, Dict, List
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.errors import AnsibleError # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()
# Copyright 2020 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = """
name: {{ lookup_name }}
Expand Down Expand Up @@ -45,6 +40,14 @@ _list:
type: list
"""

from typing import Any, Dict, List, Optional

from ansible.errors import AnsibleError # type: ignore
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()


class LookupModule(LookupBase): # type: ignore[misc]
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
"""An example lookup plugin file."""
# hello_world.py - A custom lookup plugin for Ansible.

# pylint: disable=E0401
# hello_world.py - A custom lookup plugin for Ansible.
# Author: Your Name
# License: GPL-3.0-or-later

from typing import Any, Optional, Dict, List
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.errors import AnsibleError # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()
# Author: Your Name (@username)
# Copyright 2020 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = """
name: hello_world
author: Your Name
author: Your Name (@username)
version_added: "1.0.0"
short_description: A custom lookup plugin for Ansible.
description:
Expand All @@ -39,6 +34,14 @@
type: list
"""

from typing import Any, Dict, List, Optional

from ansible.errors import AnsibleError # type: ignore
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()


class LookupModule(LookupBase): # type: ignore[misc]
"""
Expand Down

0 comments on commit ff8705e

Please sign in to comment.