We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
remnants of ansible-lint in molecule docs
<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Do not report bugs before reproducing them with the code of the main branch! -->
<!--- Please also check https://molecule.readthedocs.io/en/latest/faq.html --->
<!--- Please use https://groups.google.com/forum/#!forum/molecule-users for usage questions -->

# Issue Type

- Bug report

# Molecule and Ansible details

Note: the python was installed via conda, but the python packages are installed using pip, not conda.
```
ansible [core 2.12.2]
  python version = 3.9.10 | packaged by conda-forge | (main, Feb  1 2022, 21:25:34) [Clang 11.1.0 ]
  jinja version = 3.0.3
  libyaml = True
  ansible python module location = /opt/homebrew/Caskroom/miniconda/base/envs/tmptest/lib/python3.9/site-packages/ansible
molecule 3.6.1 using python 3.9
    ansible:2.12.2
    delegated:3.6.1 from molecule
```

Molecule installation method (one of):

- pip

Ansible installation method (one of):

- pip

Detail any linters or test runners used:

ansible-lint

# Desired Behavior

Assuming ansible-lint was removed for good reason and shouldn't be added back into the `molecule[lint]` extra:

I think this would make clearer ansible-lint is never installed by molecule:
* add note here that ansible-lint is not installed by molecule, even if you installed the `[lint]` extra
 https://molecule.readthedocs.io/en/latest/configuration.html?highlight=ansible-lint#lint
* remove misleading comment in setup.cfg https://github.com/ansible-community/molecule/blob/c33c205b570cd95d599d16afa8772fabba51dd40/setup.cfg#L112
* change to actual default (yamllint) https://github.com/ansible-community/molecule/blob/c7ae6a27bed9ba6423d6dfe11d8e0d5c54da094f/src/molecule/command/init/scenario.py#L165




# Actual Behaviour

I can't say for sure (don't know project history well enough) but I *think* ansible-lint was once available through the `molecule[lint]` extra, but was subsequently promoted to a regular dependency, and eventually removed from molecule deps altogether. It appears there were a few spots in docs that got missed and may mislead a new user (see: me) into thinking ansible-lint will be installed with `pip install molecule[lint]` when in fact it is not.





--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/molecule/command/init/scenario.py`
Content:
```
1 #  Copyright (c) 2015-2018 Cisco Systems, Inc.
2 #
3 #  Permission is hereby granted, free of charge, to any person obtaining a copy
4 #  of this software and associated documentation files (the "Software"), to
5 #  deal in the Software without restriction, including without limitation the
6 #  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 #  sell copies of the Software, and to permit persons to whom the Software is
8 #  furnished to do so, subject to the following conditions:
9 #
10 #  The above copyright notice and this permission notice shall be included in
11 #  all copies or substantial portions of the Software.
12 #
13 #  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 #  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 #  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 #  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 #  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 #  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 #  DEALINGS IN THE SOFTWARE.
20 """Base class used by init scenario command."""
21 
22 import logging
23 import os
24 from typing import Dict
25 
26 import click
27 
28 from molecule import api, config, util
29 from molecule.command import base as command_base
30 from molecule.command.init import base
31 from molecule.config import DEFAULT_DRIVER
32 
33 LOG = logging.getLogger(__name__)
34 
35 
36 class Scenario(base.Base):
37     """
38     Scenario Class.
39 
40     .. program:: molecule init scenario bar --role-name foo
41 
42     .. option:: molecule init scenario bar --role-name foo
43 
44         Initialize a new scenario. In order to customise the role, please refer
45         to the `init role` command.
46 
47     .. program:: cd foo; molecule init scenario bar --role-name foo
48 
49     .. option:: cd foo; molecule init scenario bar --role-name foo
50 
51         Initialize an existing role with Molecule:
52 
53     .. program:: cd foo; molecule init scenario bar --role-name foo
54 
55     .. option:: cd foo; molecule init scenario bar --role-name foo
56 
57         Initialize a new scenario using a local *cookiecutter* template for the
58         driver configuration.
59     """  # noqa
60 
61     def __init__(self, command_args: Dict[str, str]):
62         """Construct Scenario."""
63         self._command_args = command_args
64 
65     def execute(self):
66         """
67         Execute the actions necessary to perform a `molecule init scenario` and \
68         returns None.
69 
70         :return: None
71         """
72         scenario_name = self._command_args["scenario_name"]
73         role_name = os.getcwd().split(os.sep)[-1]
74         role_directory = util.abs_path(os.path.join(os.getcwd(), os.pardir))
75 
76         msg = f"Initializing new scenario {scenario_name}..."
77         LOG.info(msg)
78         molecule_directory = config.molecule_directory(
79             os.path.join(role_directory, role_name)
80         )
81         scenario_directory = os.path.join(molecule_directory, scenario_name)
82 
83         if os.path.isdir(scenario_directory):
84             msg = (
85                 f"The directory molecule/{scenario_name} exists. "
86                 "Cannot create new scenario."
87             )
88             util.sysexit_with_message(msg)
89 
90         driver_template = api.drivers()[
91             self._command_args["driver_name"]
92         ].template_dir()
93         if "driver_template" in self._command_args:
94             self._validate_template_dir(self._command_args["driver_template"])
95             cli_driver_template = f"{self._command_args['driver_template']}/{self._command_args['driver_name']}"
96             if os.path.isdir(cli_driver_template):
97                 driver_template = cli_driver_template
98             else:
99                 LOG.warning(
100                     "Driver not found in custom template directory(%s), "
101                     "using the default template instead",
102                     cli_driver_template,
103                 )
104         scenario_base_directory = os.path.join(role_directory, role_name)
105         templates = [
106             driver_template,
107             api.verifiers()[self._command_args["verifier_name"]].template_dir(),
108         ]
109         self._process_templates("molecule", self._command_args, role_directory)
110         for template in templates:
111             self._process_templates(
112                 template, self._command_args, scenario_base_directory
113             )
114 
115         role_directory = os.path.join(role_directory, role_name)
116         msg = f"Initialized scenario in {scenario_directory} successfully."
117         LOG.info(msg)
118 
119 
120 def _role_exists(ctx, param, value: str):  # pragma: no cover
121     # if role name was not mentioned we assume that current directory is the
122     # one hosting the role and determining the role name.
123     if not value:
124         value = os.path.basename(os.getcwd())
125 
126     role_directory = os.path.join(os.pardir, value)
127     if not os.path.exists(role_directory):
128         msg = f"The role '{value}' not found. " "Please choose the proper role name."
129         util.sysexit_with_message(msg)
130     return value
131 
132 
133 def _default_scenario_exists(ctx, param, value: str):  # pragma: no cover
134     if value == command_base.MOLECULE_DEFAULT_SCENARIO_NAME:
135         return value
136 
137     default_scenario_directory = os.path.join(
138         "molecule", command_base.MOLECULE_DEFAULT_SCENARIO_NAME
139     )
140     if not os.path.exists(default_scenario_directory):
141         msg = f"The default scenario not found.  Please create a scenario named '{command_base.MOLECULE_DEFAULT_SCENARIO_NAME}' first."
142         util.sysexit_with_message(msg)
143     return value
144 
145 
146 @command_base.click_command_ex()
147 @click.pass_context
148 @click.option(
149     "--dependency-name",
150     type=click.Choice(["galaxy"]),
151     default="galaxy",
152     help="Name of dependency to initialize. (galaxy)",
153 )
154 @click.option(
155     "--driver-name",
156     "-d",
157     type=click.Choice([str(s) for s in api.drivers()]),
158     default=DEFAULT_DRIVER,
159     help=f"Name of driver to initialize. ({DEFAULT_DRIVER})",
160 )
161 @click.option(
162     "--lint-name",
163     type=click.Choice(["yamllint"]),
164     default="yamllint",
165     help="Name of lint to initialize. (ansible-lint)",
166 )
167 @click.option(
168     "--provisioner-name",
169     type=click.Choice(["ansible"]),
170     default="ansible",
171     help="Name of provisioner to initialize. (ansible)",
172 )
173 @click.option(
174     "--role-name",
175     "-r",
176     required=False,
177     callback=_role_exists,
178     help="Name of the role to create.",
179 )
180 @click.argument(
181     "scenario-name",
182     default=command_base.MOLECULE_DEFAULT_SCENARIO_NAME,
183     required=False,
184     callback=_default_scenario_exists,
185 )
186 @click.option(
187     "--verifier-name",
188     type=click.Choice([str(s) for s in api.verifiers()]),
189     default="ansible",
190     help="Name of verifier to initialize. (ansible)",
191 )
192 def scenario(
193     ctx,
194     dependency_name,
195     driver_name,
196     lint_name,
197     provisioner_name,
198     role_name,
199     scenario_name,
200     verifier_name,
201 ):  # pragma: no cover
202     """Initialize a new scenario for use with Molecule.
203 
204     If name is not specified the 'default' value will be used.
205     """
206     command_args = {
207         "dependency_name": dependency_name,
208         "driver_name": driver_name,
209         "lint_name": lint_name,
210         "provisioner_name": provisioner_name,
211         "role_name": role_name,
212         "scenario_name": scenario_name,
213         "subcommand": __name__,
214         "verifier_name": verifier_name,
215     }
216 
217     s = Scenario(command_args)
218     s.execute()
219
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/molecule/command/init/scenario.py b/src/molecule/command/init/scenario.py
--- a/src/molecule/command/init/scenario.py
+++ b/src/molecule/command/init/scenario.py
@@ -162,7 +162,7 @@
     "--lint-name",
     type=click.Choice(["yamllint"]),
     default="yamllint",
-    help="Name of lint to initialize. (ansible-lint)",
+    help="Name of lint to initialize. (yamllint)",
 )
 @click.option(
     "--provisioner-name",

{"golden_diff": "diff --git a/src/molecule/command/init/scenario.py b/src/molecule/command/init/scenario.py\n--- a/src/molecule/command/init/scenario.py\n+++ b/src/molecule/command/init/scenario.py\n@@ -162,7 +162,7 @@\n     \"--lint-name\",\n     type=click.Choice([\"yamllint\"]),\n     default=\"yamllint\",\n-    help=\"Name of lint to initialize. (ansible-lint)\",\n+    help=\"Name of lint to initialize. (yamllint)\",\n )\n @click.option(\n     \"--provisioner-name\",\n", "issue": "remnants of ansible-lint in molecule docs\n<!--- Verify first that your issue is not already reported on GitHub -->\r\n<!--- Do not report bugs before reproducing them with the code of the main branch! -->\r\n<!--- Please also check https://molecule.readthedocs.io/en/latest/faq.html --->\r\n<!--- Please use https://groups.google.com/forum/#!forum/molecule-users for usage questions -->\r\n\r\n# Issue Type\r\n\r\n- Bug report\r\n\r\n# Molecule and Ansible details\r\n\r\nNote: the python was installed via conda, but the python packages are installed using pip, not conda.\r\n```\r\nansible [core 2.12.2]\r\n  python version = 3.9.10 | packaged by conda-forge | (main, Feb  1 2022, 21:25:34) [Clang 11.1.0 ]\r\n  jinja version = 3.0.3\r\n  libyaml = True\r\n  ansible python module location = /opt/homebrew/Caskroom/miniconda/base/envs/tmptest/lib/python3.9/site-packages/ansible\r\nmolecule 3.6.1 using python 3.9\r\n    ansible:2.12.2\r\n    delegated:3.6.1 from molecule\r\n```\r\n\r\nMolecule installation method (one of):\r\n\r\n- pip\r\n\r\nAnsible installation method (one of):\r\n\r\n- pip\r\n\r\nDetail any linters or test runners used:\r\n\r\nansible-lint\r\n\r\n# Desired Behavior\r\n\r\nAssuming ansible-lint was removed for good reason and shouldn't be added back into the `molecule[lint]` extra:\r\n\r\nI think this would make clearer ansible-lint is never installed by molecule:\r\n* add note here that ansible-lint is not installed by molecule, even if you installed the `[lint]` extra\r\n https://molecule.readthedocs.io/en/latest/configuration.html?highlight=ansible-lint#lint\r\n* remove misleading comment in setup.cfg https://github.com/ansible-community/molecule/blob/c33c205b570cd95d599d16afa8772fabba51dd40/setup.cfg#L112\r\n* change to actual default (yamllint) https://github.com/ansible-community/molecule/blob/c7ae6a27bed9ba6423d6dfe11d8e0d5c54da094f/src/molecule/command/init/scenario.py#L165\r\n\r\n\r\n\r\n\r\n# Actual Behaviour\r\n\r\nI can't say for sure (don't know project history well enough) but I *think* ansible-lint was once available through the `molecule[lint]` extra, but was subsequently promoted to a regular dependency, and eventually removed from molecule deps altogether. It appears there were a few spots in docs that got missed and may mislead a new user (see: me) into thinking ansible-lint will be installed with `pip install molecule[lint]` when in fact it is not.\r\n\r\n\r\n\r\n\n", "before_files": [{"content": "#  Copyright (c) 2015-2018 Cisco Systems, Inc.\n#\n#  Permission is hereby granted, free of charge, to any person obtaining a copy\n#  of this software and associated documentation files (the \"Software\"), to\n#  deal in the Software without restriction, including without limitation the\n#  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n#  sell copies of the Software, and to permit persons to whom the Software is\n#  furnished to do so, subject to the following conditions:\n#\n#  The above copyright notice and this permission notice shall be included in\n#  all copies or substantial portions of the Software.\n#\n#  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n#  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n#  DEALINGS IN THE SOFTWARE.\n\"\"\"Base class used by init scenario command.\"\"\"\n\nimport logging\nimport os\nfrom typing import Dict\n\nimport click\n\nfrom molecule import api, config, util\nfrom molecule.command import base as command_base\nfrom molecule.command.init import base\nfrom molecule.config import DEFAULT_DRIVER\n\nLOG = logging.getLogger(__name__)\n\n\nclass Scenario(base.Base):\n    \"\"\"\n    Scenario Class.\n\n    .. program:: molecule init scenario bar --role-name foo\n\n    .. option:: molecule init scenario bar --role-name foo\n\n        Initialize a new scenario. In order to customise the role, please refer\n        to the `init role` command.\n\n    .. program:: cd foo; molecule init scenario bar --role-name foo\n\n    .. option:: cd foo; molecule init scenario bar --role-name foo\n\n        Initialize an existing role with Molecule:\n\n    .. program:: cd foo; molecule init scenario bar --role-name foo\n\n    .. option:: cd foo; molecule init scenario bar --role-name foo\n\n        Initialize a new scenario using a local *cookiecutter* template for the\n        driver configuration.\n    \"\"\"  # noqa\n\n    def __init__(self, command_args: Dict[str, str]):\n        \"\"\"Construct Scenario.\"\"\"\n        self._command_args = command_args\n\n    def execute(self):\n        \"\"\"\n        Execute the actions necessary to perform a `molecule init scenario` and \\\n        returns None.\n\n        :return: None\n        \"\"\"\n        scenario_name = self._command_args[\"scenario_name\"]\n        role_name = os.getcwd().split(os.sep)[-1]\n        role_directory = util.abs_path(os.path.join(os.getcwd(), os.pardir))\n\n        msg = f\"Initializing new scenario {scenario_name}...\"\n        LOG.info(msg)\n        molecule_directory = config.molecule_directory(\n            os.path.join(role_directory, role_name)\n        )\n        scenario_directory = os.path.join(molecule_directory, scenario_name)\n\n        if os.path.isdir(scenario_directory):\n            msg = (\n                f\"The directory molecule/{scenario_name} exists. \"\n                \"Cannot create new scenario.\"\n            )\n            util.sysexit_with_message(msg)\n\n        driver_template = api.drivers()[\n            self._command_args[\"driver_name\"]\n        ].template_dir()\n        if \"driver_template\" in self._command_args:\n            self._validate_template_dir(self._command_args[\"driver_template\"])\n            cli_driver_template = f\"{self._command_args['driver_template']}/{self._command_args['driver_name']}\"\n            if os.path.isdir(cli_driver_template):\n                driver_template = cli_driver_template\n            else:\n                LOG.warning(\n                    \"Driver not found in custom template directory(%s), \"\n                    \"using the default template instead\",\n                    cli_driver_template,\n                )\n        scenario_base_directory = os.path.join(role_directory, role_name)\n        templates = [\n            driver_template,\n            api.verifiers()[self._command_args[\"verifier_name\"]].template_dir(),\n        ]\n        self._process_templates(\"molecule\", self._command_args, role_directory)\n        for template in templates:\n            self._process_templates(\n                template, self._command_args, scenario_base_directory\n            )\n\n        role_directory = os.path.join(role_directory, role_name)\n        msg = f\"Initialized scenario in {scenario_directory} successfully.\"\n        LOG.info(msg)\n\n\ndef _role_exists(ctx, param, value: str):  # pragma: no cover\n    # if role name was not mentioned we assume that current directory is the\n    # one hosting the role and determining the role name.\n    if not value:\n        value = os.path.basename(os.getcwd())\n\n    role_directory = os.path.join(os.pardir, value)\n    if not os.path.exists(role_directory):\n        msg = f\"The role '{value}' not found. \" \"Please choose the proper role name.\"\n        util.sysexit_with_message(msg)\n    return value\n\n\ndef _default_scenario_exists(ctx, param, value: str):  # pragma: no cover\n    if value == command_base.MOLECULE_DEFAULT_SCENARIO_NAME:\n        return value\n\n    default_scenario_directory = os.path.join(\n        \"molecule\", command_base.MOLECULE_DEFAULT_SCENARIO_NAME\n    )\n    if not os.path.exists(default_scenario_directory):\n        msg = f\"The default scenario not found.  Please create a scenario named '{command_base.MOLECULE_DEFAULT_SCENARIO_NAME}' first.\"\n        util.sysexit_with_message(msg)\n    return value\n\n\n@command_base.click_command_ex()\n@click.pass_context\n@click.option(\n    \"--dependency-name\",\n    type=click.Choice([\"galaxy\"]),\n    default=\"galaxy\",\n    help=\"Name of dependency to initialize. (galaxy)\",\n)\n@click.option(\n    \"--driver-name\",\n    \"-d\",\n    type=click.Choice([str(s) for s in api.drivers()]),\n    default=DEFAULT_DRIVER,\n    help=f\"Name of driver to initialize. ({DEFAULT_DRIVER})\",\n)\n@click.option(\n    \"--lint-name\",\n    type=click.Choice([\"yamllint\"]),\n    default=\"yamllint\",\n    help=\"Name of lint to initialize. (ansible-lint)\",\n)\n@click.option(\n    \"--provisioner-name\",\n    type=click.Choice([\"ansible\"]),\n    default=\"ansible\",\n    help=\"Name of provisioner to initialize. (ansible)\",\n)\n@click.option(\n    \"--role-name\",\n    \"-r\",\n    required=False,\n    callback=_role_exists,\n    help=\"Name of the role to create.\",\n)\n@click.argument(\n    \"scenario-name\",\n    default=command_base.MOLECULE_DEFAULT_SCENARIO_NAME,\n    required=False,\n    callback=_default_scenario_exists,\n)\n@click.option(\n    \"--verifier-name\",\n    type=click.Choice([str(s) for s in api.verifiers()]),\n    default=\"ansible\",\n    help=\"Name of verifier to initialize. (ansible)\",\n)\ndef scenario(\n    ctx,\n    dependency_name,\n    driver_name,\n    lint_name,\n    provisioner_name,\n    role_name,\n    scenario_name,\n    verifier_name,\n):  # pragma: no cover\n    \"\"\"Initialize a new scenario for use with Molecule.\n\n    If name is not specified the 'default' value will be used.\n    \"\"\"\n    command_args = {\n        \"dependency_name\": dependency_name,\n        \"driver_name\": driver_name,\n        \"lint_name\": lint_name,\n        \"provisioner_name\": provisioner_name,\n        \"role_name\": role_name,\n        \"scenario_name\": scenario_name,\n        \"subcommand\": __name__,\n        \"verifier_name\": verifier_name,\n    }\n\n    s = Scenario(command_args)\n    s.execute()\n", "path": "src/molecule/command/init/scenario.py"}], "after_files": [{"content": "#  Copyright (c) 2015-2018 Cisco Systems, Inc.\n#\n#  Permission is hereby granted, free of charge, to any person obtaining a copy\n#  of this software and associated documentation files (the \"Software\"), to\n#  deal in the Software without restriction, including without limitation the\n#  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n#  sell copies of the Software, and to permit persons to whom the Software is\n#  furnished to do so, subject to the following conditions:\n#\n#  The above copyright notice and this permission notice shall be included in\n#  all copies or substantial portions of the Software.\n#\n#  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n#  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n#  DEALINGS IN THE SOFTWARE.\n\"\"\"Base class used by init scenario command.\"\"\"\n\nimport logging\nimport os\nfrom typing import Dict\n\nimport click\n\nfrom molecule import api, config, util\nfrom molecule.command import base as command_base\nfrom molecule.command.init import base\nfrom molecule.config import DEFAULT_DRIVER\n\nLOG = logging.getLogger(__name__)\n\n\nclass Scenario(base.Base):\n    \"\"\"\n    Scenario Class.\n\n    .. program:: molecule init scenario bar --role-name foo\n\n    .. option:: molecule init scenario bar --role-name foo\n\n        Initialize a new scenario. In order to customise the role, please refer\n        to the `init role` command.\n\n    .. program:: cd foo; molecule init scenario bar --role-name foo\n\n    .. option:: cd foo; molecule init scenario bar --role-name foo\n\n        Initialize an existing role with Molecule:\n\n    .. program:: cd foo; molecule init scenario bar --role-name foo\n\n    .. option:: cd foo; molecule init scenario bar --role-name foo\n\n        Initialize a new scenario using a local *cookiecutter* template for the\n        driver configuration.\n    \"\"\"  # noqa\n\n    def __init__(self, command_args: Dict[str, str]):\n        \"\"\"Construct Scenario.\"\"\"\n        self._command_args = command_args\n\n    def execute(self):\n        \"\"\"\n        Execute the actions necessary to perform a `molecule init scenario` and \\\n        returns None.\n\n        :return: None\n        \"\"\"\n        scenario_name = self._command_args[\"scenario_name\"]\n        role_name = os.getcwd().split(os.sep)[-1]\n        role_directory = util.abs_path(os.path.join(os.getcwd(), os.pardir))\n\n        msg = f\"Initializing new scenario {scenario_name}...\"\n        LOG.info(msg)\n        molecule_directory = config.molecule_directory(\n            os.path.join(role_directory, role_name)\n        )\n        scenario_directory = os.path.join(molecule_directory, scenario_name)\n\n        if os.path.isdir(scenario_directory):\n            msg = (\n                f\"The directory molecule/{scenario_name} exists. \"\n                \"Cannot create new scenario.\"\n            )\n            util.sysexit_with_message(msg)\n\n        driver_template = api.drivers()[\n            self._command_args[\"driver_name\"]\n        ].template_dir()\n        if \"driver_template\" in self._command_args:\n            self._validate_template_dir(self._command_args[\"driver_template\"])\n            cli_driver_template = f\"{self._command_args['driver_template']}/{self._command_args['driver_name']}\"\n            if os.path.isdir(cli_driver_template):\n                driver_template = cli_driver_template\n            else:\n                LOG.warning(\n                    \"Driver not found in custom template directory(%s), \"\n                    \"using the default template instead\",\n                    cli_driver_template,\n                )\n        scenario_base_directory = os.path.join(role_directory, role_name)\n        templates = [\n            driver_template,\n            api.verifiers()[self._command_args[\"verifier_name\"]].template_dir(),\n        ]\n        self._process_templates(\"molecule\", self._command_args, role_directory)\n        for template in templates:\n            self._process_templates(\n                template, self._command_args, scenario_base_directory\n            )\n\n        role_directory = os.path.join(role_directory, role_name)\n        msg = f\"Initialized scenario in {scenario_directory} successfully.\"\n        LOG.info(msg)\n\n\ndef _role_exists(ctx, param, value: str):  # pragma: no cover\n    # if role name was not mentioned we assume that current directory is the\n    # one hosting the role and determining the role name.\n    if not value:\n        value = os.path.basename(os.getcwd())\n\n    role_directory = os.path.join(os.pardir, value)\n    if not os.path.exists(role_directory):\n        msg = f\"The role '{value}' not found. \" \"Please choose the proper role name.\"\n        util.sysexit_with_message(msg)\n    return value\n\n\ndef _default_scenario_exists(ctx, param, value: str):  # pragma: no cover\n    if value == command_base.MOLECULE_DEFAULT_SCENARIO_NAME:\n        return value\n\n    default_scenario_directory = os.path.join(\n        \"molecule\", command_base.MOLECULE_DEFAULT_SCENARIO_NAME\n    )\n    if not os.path.exists(default_scenario_directory):\n        msg = f\"The default scenario not found.  Please create a scenario named '{command_base.MOLECULE_DEFAULT_SCENARIO_NAME}' first.\"\n        util.sysexit_with_message(msg)\n    return value\n\n\n@command_base.click_command_ex()\n@click.pass_context\n@click.option(\n    \"--dependency-name\",\n    type=click.Choice([\"galaxy\"]),\n    default=\"galaxy\",\n    help=\"Name of dependency to initialize. (galaxy)\",\n)\n@click.option(\n    \"--driver-name\",\n    \"-d\",\n    type=click.Choice([str(s) for s in api.drivers()]),\n    default=DEFAULT_DRIVER,\n    help=f\"Name of driver to initialize. ({DEFAULT_DRIVER})\",\n)\n@click.option(\n    \"--lint-name\",\n    type=click.Choice([\"yamllint\"]),\n    default=\"yamllint\",\n    help=\"Name of lint to initialize. (yamllint)\",\n)\n@click.option(\n    \"--provisioner-name\",\n    type=click.Choice([\"ansible\"]),\n    default=\"ansible\",\n    help=\"Name of provisioner to initialize. (ansible)\",\n)\n@click.option(\n    \"--role-name\",\n    \"-r\",\n    required=False,\n    callback=_role_exists,\n    help=\"Name of the role to create.\",\n)\n@click.argument(\n    \"scenario-name\",\n    default=command_base.MOLECULE_DEFAULT_SCENARIO_NAME,\n    required=False,\n    callback=_default_scenario_exists,\n)\n@click.option(\n    \"--verifier-name\",\n    type=click.Choice([str(s) for s in api.verifiers()]),\n    default=\"ansible\",\n    help=\"Name of verifier to initialize. (ansible)\",\n)\ndef scenario(\n    ctx,\n    dependency_name,\n    driver_name,\n    lint_name,\n    provisioner_name,\n    role_name,\n    scenario_name,\n    verifier_name,\n):  # pragma: no cover\n    \"\"\"Initialize a new scenario for use with Molecule.\n\n    If name is not specified the 'default' value will be used.\n    \"\"\"\n    command_args = {\n        \"dependency_name\": dependency_name,\n        \"driver_name\": driver_name,\n        \"lint_name\": lint_name,\n        \"provisioner_name\": provisioner_name,\n        \"role_name\": role_name,\n        \"scenario_name\": scenario_name,\n        \"subcommand\": __name__,\n        \"verifier_name\": verifier_name,\n    }\n\n    s = Scenario(command_args)\n    s.execute()\n", "path": "src/molecule/command/init/scenario.py"}]}