Codebase list python-procrunner / 3f715f6
Remove deprecated run_process() function Markus Gerstel 3 years ago
2 changed file(s) with 1 addition(s) and 41 deletion(s). Raw diff Collapse all Expand all
55 -----
66
77 * Python 3.5+ only, support for Python 2.7 has been dropped
8 * Deprecated function alias run_process() has been removed
89
910
1011 1.1.0 (2019-11-04)
570570 )
571571
572572 return result
573
574
575 def run_process_dummy(command, **kwargs):
576 """
577 A stand-in function that returns a valid result dictionary indicating a
578 successful execution. The external process is not run.
579 """
580 warnings.warn(
581 "procrunner.run_process_dummy() is deprecated", DeprecationWarning, stacklevel=2
582 )
583
584 time_start = time.strftime("%Y-%m-%d %H:%M:%S GMT", time.gmtime())
585 logger.info("run_process is disabled. Requested command: %s", command)
586
587 result = ReturnObject(
588 {
589 "exitcode": 0,
590 "command": command,
591 "stdout": "",
592 "stderr": "",
593 "timeout": False,
594 "runtime": 0,
595 "time_start": time_start,
596 "time_end": time_start,
597 }
598 )
599 if kwargs.get("stdin") is not None:
600 result.update(
601 {"stdin_bytes_sent": len(kwargs["stdin"]), "stdin_bytes_remain": 0}
602 )
603 return result
604
605
606 def run_process(*args, **kwargs):
607 """API used up to version 0.2.0."""
608 warnings.warn(
609 "procrunner.run_process() is deprecated and has been renamed to run()",
610 DeprecationWarning,
611 stacklevel=2,
612 )
613 return run(*args, **kwargs)