Skip to content

Commit

Permalink
Fix confusing function name
Browse files Browse the repository at this point in the history
  • Loading branch information
amaslenn committed Jan 14, 2025
1 parent 5eeb2ac commit b539213
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cloudai/_core/base_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def is_dir_writable(path: Path) -> bool:
return not os.access(path, os.W_OK) or not path.is_dir()
return os.access(path, os.W_OK) and path.is_dir()


class BaseInstaller(ABC):
Expand Down Expand Up @@ -90,7 +90,7 @@ def is_installed(self, items: Iterable[Installable]) -> InstallStatusResult:
Returns:
InstallStatusResult: Result containing the installation status and error message if not installed.
"""
if is_dir_writable(self.system.install_path):
if not is_dir_writable(self.system.install_path):
return InstallStatusResult(
False, f"The installation path {self.system.install_path} is not a writable directory."
)
Expand Down Expand Up @@ -131,7 +131,7 @@ def install(self, items: Iterable[Installable]) -> InstallStatusResult:
False, f"Failed to create installation directory at {self.system.install_path}: {e}"
)

if is_dir_writable(self.system.install_path):
if not is_dir_writable(self.system.install_path):
return InstallStatusResult(
False, f"The installation path {self.system.install_path} is not a writable directory."
)
Expand Down

0 comments on commit b539213

Please sign in to comment.