Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii committed Jun 18, 2024
1 parent 08cc8f6 commit 169c9a9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/ansible_navigator/actions/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ def _run_runner(self) -> None:
}

if isinstance(self._args.playbook, str):
playbook_dir = Path(self._args.playbook).parent
playbook_dir = f"{Path(self._args.playbook).parent}"

Check warning on line 418 in src/ansible_navigator/actions/collections.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_navigator/actions/collections.py#L418

Added line #L418 was not covered by tests
else:
playbook_dir = Path.cwd()
playbook_dir = os.getcwd()

if isinstance(self._args.execution_environment_volume_mounts, list):
kwargs["container_volume_mounts"] = self._args.execution_environment_volume_mounts
Expand Down Expand Up @@ -566,7 +566,7 @@ def _parse(self, output: str) -> None:
"path"
].startswith(self._adjacent_collection_dir):
collection["__type"] = "bind_mount"
elif collection["path"].startswith(Path(self._adjacent_collection_dir).parent):
elif collection["path"].startswith(f"{Path(self._adjacent_collection_dir).parent}"):
collection["__type"] = "bind_mount"
error = (
f"{collection['known_as']} was mounted and catalogued in the"
Expand Down
4 changes: 2 additions & 2 deletions src/ansible_navigator/actions/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def _run_runner(self) -> dict[Any, Any] | tuple[str, str, int] | None:

if self._args.mode == "interactive":
if isinstance(self._args.playbook, str):
playbook_dir = Path(self._args.playbook).parent
playbook_dir = f"{Path(self._args.playbook).parent}"

Check warning on line 181 in src/ansible_navigator/actions/doc.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_navigator/actions/doc.py#L181

Added line #L181 was not covered by tests
else:
playbook_dir = Path.cwd()
playbook_dir = os.getcwd()
kwargs.update({"host_cwd": playbook_dir})

self._runner = AnsibleDoc(**kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_and_check_collection_doc_cache(
try:
doc_cache_dir.mkdir(parents=True, exist_ok=True)
except OSError as exc:
path_errors.append(f"Problem making directory: {doc_cache_dir}")
path_errors.append(f"Problem making directory: {doc_cache_dir!s}")

Check warning on line 114 in src/ansible_navigator/initialization.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_navigator/initialization.py#L114

Added line #L114 was not covered by tests
path_errors.append(f"Error was: {exc!s}")

if not os.access(Path(collection_doc_cache_path).parent, os.W_OK):
Expand Down
7 changes: 1 addition & 6 deletions src/ansible_navigator/runner/ansible_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from typing import Any

from ansible_runner import get_plugin_docs

from .base import Base


if TYPE_CHECKING:
from pathlib import Path


class AnsibleDoc(Base):
# pylint: disable=too-many-arguments
"""An interface to ``ansible-runner`` for running the ``ansible-doc`` command."""
Expand All @@ -24,7 +19,7 @@ def fetch_plugin_doc(
plugin_type: str | None = None,
response_format: str | None = "json",
snippet: bool | None = None,
playbook_dir: str | Path | None = None,
playbook_dir: str | None = None,
module_path: str | None = None,
) -> tuple[dict[Any, Any] | str, dict[Any, Any] | str]:
"""Run ``ansible-doc`` command and get the plugin docs related details.
Expand Down

0 comments on commit 169c9a9

Please sign in to comment.