Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ansible/molecule
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.3.1
Choose a base ref
...
head repository: ansible/molecule
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.3.3
Choose a head ref
  • 7 commits
  • 11 files changed
  • 2 contributors

Commits on May 17, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    20f3a5f View commit details

Commits on May 18, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ce9f9df View commit details

Commits on May 19, 2021

  1. Fix ansible_ssh_common_args in molecule.yml (#3121)

    * Fix ansible_ssh_common_args in molecule.yml
    
    Makes the option `ansible_ssh_common_args` in molecule.yml work as documented.
    
    * Fixed formatting (black)
    
    Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
    gardar and ssbarnea authored May 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6f52203 View commit details
  2. Require ansible-lint 5.0.9 (#3125)

    In order to make use of the newer logic regarding preinstalling
    requirements bump version of ansible-lint used.
    
    Fixes: #3055
    ssbarnea authored May 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    af5b90f View commit details

Commits on Jun 1, 2021

  1. Fix docs building (#3133)

    ssbarnea authored Jun 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fd727b9 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c73a1c2 View commit details
  3. Avoid using in-repo .cache folder (#3128)

    Bump ansible-lint dependency to 5.0.10 in order to make use of the
    ansible/ansible-lint#1567 which
    basically moves the tmp folder to use ~/.cache, avoiding
    pypa/pip#10005
    ssbarnea authored Jun 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7b297ae View commit details
12 changes: 6 additions & 6 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -25,17 +25,17 @@ jobs:
- tox_env: lint
- tox_env: docs
- tox_env: py36
PREFIX: PYTEST_REQPASS=435
PREFIX: PYTEST_REQPASS=438
- tox_env: py37
PREFIX: PYTEST_REQPASS=435
PREFIX: PYTEST_REQPASS=438
- tox_env: py38
PREFIX: PYTEST_REQPASS=435
PREFIX: PYTEST_REQPASS=438
- tox_env: py39
PREFIX: PYTEST_REQPASS=435
PREFIX: PYTEST_REQPASS=438
- tox_env: py36-devel
PREFIX: PYTEST_REQPASS=435
PREFIX: PYTEST_REQPASS=438
- tox_env: py39-devel
PREFIX: PYTEST_REQPASS=435
PREFIX: PYTEST_REQPASS=438
- tox_env: packaging
- tox_env: eco
- tox_env: dockerfile
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ repos:
entry: mypy src/
pass_filenames: false
additional_dependencies:
- ansible-lint>=5.0.5
- ansible-lint>=5.0.10
- packaging
- enrich>=1.2.5
- subprocess-tee>=0.2.0
@@ -63,7 +63,7 @@ repos:
hooks:
- id: pylint
additional_dependencies:
- ansible-lint>=5.0.5
- ansible-lint>=5.0.10
- enrich>=1.2.5
- subprocess-tee>=0.2.0
- testinfra
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ Read the documentation and more at https://molecule.readthedocs.io/.
Get Involved
============

* Join us in the ``#ansible-molecule`` channel on `Freenode`_.
* Join us in the ``#ansible-molecule`` irc channel on `libera.chat`_.
* Check github `discussions`_.
* Join the community working group by checking the `wiki`_.
* Want to know about releases, subscribe to `ansible-announce list`_.
@@ -85,7 +85,7 @@ If you want to get moving fast and make a quick patch:
And you're ready to make your changes!

.. _`Freenode`: https://freenode.net
.. _`libera.chat`: https://web.libera.chat/?channel=#ansible-molecule
.. _`discussions`: https://github.com/ansible-community/molecule/discussions
.. _`wiki`: https://github.com/ansible/community/wiki/Molecule
.. _`ansible-announce list`: https://groups.google.com/group/ansible-announce
4 changes: 0 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -309,9 +309,5 @@
"virtualenv": ("https://virtualenv.pypa.io/en/latest/", None),
}

# linckchecker settings
linkcheck_ignore = [
r'http://irc\.freenode\.net',
]
linkcheck_workers = 25
# linkcheck_anchors = False
4 changes: 2 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@ Contributing
Talk to us
----------

Join us in ``#ansible-molecule`` on `freenode`_, or `molecule-users Forum`_.
Join us in ``#ansible-molecule`` on `libera.chat`_ irc, or `molecule-users Forum`_.

The full list of Ansible email lists and IRC channels can be found in the `communication page`_.

.. _`freenode`: https://freenode.net
.. _`libera.chat`: https://web.libera.chat/?channel=#ansible-molecule
.. _`molecule-users Forum`: https://groups.google.com/forum/#!forum/molecule-users
.. _`communication page`: https://docs.ansible.com/ansible/latest/community/communication.html

12 changes: 6 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -66,10 +66,9 @@ setup_requires =

# These are required in actual runtime:
install_requires =
ansible-lint >= 5.0.5 # only for the prerun functionality
cerberus >= 1.3.1
click >= 7.0
click-completion >= 0.5.1
ansible-lint >= 5.0.10 # only for the prerun functionality
cerberus >= 1.3.1, !=1.3.3, !=1.3.4
click >= 8.0, < 9
click-help-colors >= 0.9
cookiecutter >= 1.7.3 # dependency issues in older versions
dataclasses; python_version<"3.7"
@@ -95,8 +94,9 @@ ansible =
ansible-base =
ansible-base >= 2.10
docs =
simplejson
Sphinx
Sphinx >= 4.0.2
simplejson >= 3.17.2
sphinx-notfound-page >= 0.7.1
sphinx_ansible_theme >= 0.2.2
docker =
molecule-docker
8 changes: 7 additions & 1 deletion src/molecule/console.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Console and terminal utilities."""
import os
import sys
from typing import Any
from typing import Any, Dict

from enrich.console import Console
from rich.style import Style
@@ -71,9 +71,15 @@ def should_do_markup() -> bool:
return sys.stdout.isatty()


console_options: Dict[str, Any] = {"emoji": False, "theme": theme, "soft_wrap": True}

console = Console(
force_terminal=should_do_markup(), theme=theme, record=True, redirect=True
)
console_options_stderr = console_options.copy()
console_options_stderr["stderr"] = True
console_stderr: Console = Console(**console_options_stderr)

# Define ANSIBLE_FORCE_COLOR if markup is enabled and another value is not
# already given. This assures that Ansible subprocesses are still colored,
# even if they do not run with a real TTY.
11 changes: 10 additions & 1 deletion src/molecule/driver/delegated.py
Original file line number Diff line number Diff line change
@@ -171,7 +171,16 @@ def default_safe_files(self):
@property
def default_ssh_connection_options(self):
if self.managed:
return self._get_ssh_connection_options()
ssh_connopts = self._get_ssh_connection_options()
if self.options.get("ansible_connection_options", {}).get(
"ansible_ssh_common_args", None
):
ssh_connopts.append(
self.options.get("ansible_connection_options").get(
"ansible_ssh_common_args"
)
)
return ssh_connopts
return []

def login_options(self, instance_name):
4 changes: 2 additions & 2 deletions src/molecule/logger.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

from enrich.logging import RichHandler

from molecule.console import console
from molecule.console import console, console_stderr
from molecule.text import underscore

LOG = logging.getLogger(__name__)
@@ -48,7 +48,7 @@ def configure() -> None:
# libraries.
logger = logging.getLogger()
handler = RichHandler(
console=console, show_time=False, show_path=False, markup=True
console=console_stderr, show_time=False, show_path=False, markup=True
) # type: ignore
logger.addHandler(handler)
logger.propagate = False
8 changes: 3 additions & 5 deletions src/molecule/shell.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@
import sys

import click
import click_completion
import pkg_resources

import molecule
@@ -34,8 +33,6 @@
from molecule.console import console
from molecule.util import do_report, lookup_config_file

click_completion.init()

# Setup logging. This location of initialization is not ideal, but the code
# structure does not give us much choice because config file lookup down below
# uses logging facilities. Do note that verbosity level set by the
@@ -115,9 +112,10 @@ def main(ctx, debug, verbose, base_config, env_file): # pragma: no cover
"""
Molecule aids in the development and testing of Ansible roles.
Enable autocomplete issue:
To enable autocomplete for a supported shell execute command below after
replacing SHELL with either bash, zsh, or fish:
eval "$(_MOLECULE_COMPLETE=source molecule)"
eval "$(_MOLECULE_COMPLETE=SHELL_source molecule)"
"""
ctx.obj = {}
ctx.obj["args"] = {}
17 changes: 17 additions & 0 deletions src/molecule/test/unit/command/test_base.py
Original file line number Diff line number Diff line change
@@ -282,3 +282,20 @@ def test_verify_configs_raises_with_duplicate_configs(

def test_get_subcommand():
assert "test_base" == base._get_subcommand(__name__)


@pytest.mark.parametrize(
"shell",
[
"bash",
"zsh",
"fish",
],
)
def test_command_completion(shell: str) -> None:
env = os.environ.copy()
env["_MOLECULE_COMPLETE"] = f"{shell}_source"

result = util.run_command(["molecule"], env=env)
assert result.returncode == 0
assert "Found config file" not in result.stdout