(cmd, *args, **kwargs)
| 231 | |
| 232 | |
| 233 | def _run(cmd, *args, **kwargs): |
| 234 | ctx = kwargs.pop("ctx", None) |
| 235 | if ctx and ctx.dry_run: |
| 236 | log.info("(dry-run) Not Executing command: %s", _cmdstr(cmd)) |
| 237 | # because we can not return a result (as we did nothing) |
| 238 | # raise a specific exception to be caught by higher layer |
| 239 | raise DidNotExecute(cmd) |
| 240 | |
| 241 | log.info("Executing command: %s", _cmdstr(cmd)) |
| 242 | return subprocess.run(cmd, *args, **kwargs) |
| 243 | |
| 244 | |
| 245 | def _container_cmd( |
no test coverage detected