Skip to content

Commit

Permalink
Merge pull request #4 from boegel/get_cwd
Browse files Browse the repository at this point in the history
move `CWD_NOTFOUND_ERROR` constant to `tools.build_log`
  • Loading branch information
lexming authored May 22, 2024
2 parents c3af7a8 + 27526c7 commit 336d5b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 5 additions & 0 deletions easybuild/tools/build_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
DRY_RUN_SOFTWARE_INSTALL_DIR = None
DRY_RUN_MODULES_INSTALL_DIR = None

CWD_NOTFOUND_ERROR = (
"Current working directory does not exist! It was either unexpectedly removed "
"by an external process to EasyBuild or the filesystem is misbehaving."
)


DEVEL_LOG_LEVEL = logging.DEBUG - 1
logging.addLevelName(DEVEL_LOG_LEVEL, 'DEVEL')
Expand Down
4 changes: 2 additions & 2 deletions easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@

from easybuild.base import fancylogger
# import build_log must stay, to use of EasyBuildLog
from easybuild.tools.build_log import EasyBuildError, dry_run_msg, print_msg, print_warning
from easybuild.tools.build_log import EasyBuildError, CWD_NOTFOUND_ERROR, dry_run_msg, print_msg, print_warning
from easybuild.tools.config import ERROR, GENERIC_EASYBLOCK_PKG, IGNORE, WARN, build_option, install_path
from easybuild.tools.output import PROGRESS_BAR_DOWNLOAD_ONE, start_progress_bar, stop_progress_bar, update_progress_bar
from easybuild.tools.hooks import load_source
from easybuild.tools.run import CWD_NOTFOUND_ERROR, run_shell_cmd
from easybuild.tools.run import run_shell_cmd
from easybuild.tools.utilities import natural_keys, nub, remove_unwanted_chars, trace_msg

try:
Expand Down
7 changes: 1 addition & 6 deletions easybuild/tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
from threading import get_ident as get_thread_id

from easybuild.base import fancylogger
from easybuild.tools.build_log import EasyBuildError, dry_run_msg, print_msg, time_str_since
from easybuild.tools.build_log import EasyBuildError, CWD_NOTFOUND_ERROR, dry_run_msg, print_msg, time_str_since
from easybuild.tools.config import build_option
from easybuild.tools.hooks import RUN_SHELL_CMD, load_hooks, run_hook
from easybuild.tools.utilities import trace_msg
Expand All @@ -83,11 +83,6 @@
"ulimit -u", # used in det_parallelism
)

CWD_NOTFOUND_ERROR = (
"Current working directory does not exist! It was either unexpectedly removed "
"by an external process to EasyBuild or the filesystem is misbehaving."
)

RunShellCmdResult = namedtuple('RunShellCmdResult', ('cmd', 'exit_code', 'output', 'stderr', 'work_dir',
'out_file', 'err_file', 'thread_id', 'task_id'))

Expand Down

0 comments on commit 336d5b0

Please sign in to comment.