Check if a path exists If not, log an error and exit.
(path, msg=None)
| 109 | |
| 110 | |
| 111 | def assert_exist(path, msg=None): |
| 112 | """Check if a path exists |
| 113 | |
| 114 | If not, log an error and exit.""" |
| 115 | if not os.path.exists(path): |
| 116 | logger.error('%s not found', path) |
| 117 | if msg: |
| 118 | logger.error(msg) |
| 119 | sys.exit(1) |
| 120 | |
| 121 | |
| 122 | def check_exist(path, msg=None): |
no outgoing calls
no test coverage detected