|
58 | 58 | from easybuild.tools import run |
59 | 59 | # import build_log must stay, to use of EasyBuildLog |
60 | 60 | from easybuild.tools.build_log import EasyBuildError, dry_run_msg, print_msg, print_warning |
61 | | -from easybuild.tools.config import (DEFAULT_WAIT_ON_LOCK_INTERVAL, GENERIC_EASYBLOCK_PKG, build_option, install_path, |
62 | | - IGNORE, WARN, ERROR) |
| 61 | +from easybuild.tools.config import DEFAULT_WAIT_ON_LOCK_INTERVAL, ERROR, GENERIC_EASYBLOCK_PKG, IGNORE, WARN |
| 62 | +from easybuild.tools.config import build_option, install_path |
63 | 63 | from easybuild.tools.py2vs3 import HTMLParser, std_urllib, string_type |
64 | 64 | from easybuild.tools.utilities import natural_keys, nub, remove_unwanted_chars |
65 | 65 |
|
@@ -1479,7 +1479,7 @@ def apply_regex_substitutions(paths, regex_subs, backup='.orig.eb', on_missing_m |
1479 | 1479 | """ |
1480 | 1480 | if on_missing_match is None: |
1481 | 1481 | on_missing_match = build_option('strict') |
1482 | | - allowed_values = (run.ERROR, run.WARN, run.IGNORE) |
| 1482 | + allowed_values = (ERROR, IGNORE, WARN) |
1483 | 1483 | if on_missing_match not in allowed_values: |
1484 | 1484 | raise EasyBuildError('Invalid value passed to on_missing_match: %s (allowed: %s)', |
1485 | 1485 | on_missing_match, ', '.join(allowed_values)) |
@@ -1535,9 +1535,9 @@ def apply_regex_substitutions(paths, regex_subs, backup='.orig.eb', on_missing_m |
1535 | 1535 | _log.info('Applied the following substitutions to %s:\n%s', path, '\n'.join(replacement_msgs)) |
1536 | 1536 | else: |
1537 | 1537 | msg = 'Nothing found to replace in %s' % path |
1538 | | - if on_missing_match == run.ERROR: |
| 1538 | + if on_missing_match == ERROR: |
1539 | 1539 | raise EasyBuildError(msg) |
1540 | | - elif on_missing_match == run.WARN: |
| 1540 | + elif on_missing_match == WARN: |
1541 | 1541 | _log.warning(msg) |
1542 | 1542 | else: |
1543 | 1543 | _log.info(msg) |
|
0 commit comments