Skip to content

Commit 0aed180

Browse files
authored
Remove unnecessary permission checks and exception handling in NeMoLauncherSlurmInstallStrategy (#218)
1 parent 73a6e47 commit 0aed180

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/cloudai/schema/test_template/nemo_launcher/slurm_install_strategy.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# limitations under the License.
1616

1717
import logging
18-
import os
1918
import subprocess
2019
from pathlib import Path
2120
from typing import Any, Dict
@@ -81,11 +80,6 @@ def install(self) -> InstallStatusResult:
8180
if install_status.success:
8281
return InstallStatusResult(success=True, message="NeMo-Launcher is already installed.")
8382

84-
try:
85-
self._check_install_path_access()
86-
except PermissionError as e:
87-
return InstallStatusResult(success=False, message=str(e))
88-
8983
subdir_path = self.system.install_path / self.SUBDIR_PATH
9084
subdir_path.mkdir(parents=True, exist_ok=True)
9185

@@ -119,19 +113,6 @@ def uninstall(self) -> InstallStatusResult:
119113

120114
return InstallStatusResult(success=True)
121115

122-
def _check_install_path_access(self):
123-
"""
124-
Check if the install path exists and if there is permission to create a directory or file in the path.
125-
126-
Raises
127-
PermissionError: If the install path does not exist or if there is no permission to create directories and
128-
files.
129-
"""
130-
if not self.system.install_path.exists():
131-
raise PermissionError(f"Install path {self.system.install_path} does not exist.")
132-
if not self.system.install_path.is_dir() or not os.access(self.system.install_path, os.W_OK):
133-
raise PermissionError(f"No permission to write in install path {self.system.install_path}.")
134-
135116
def _clone_repository(self, subdir_path: Path) -> None:
136117
"""
137118
Clones NeMo-Launcher repository into specified path if it does not already exist.

0 commit comments

Comments
 (0)