MCPcopy
hub / github.com/saltstack/salt / _check_retcode

Method _check_retcode

tests/support/pkg.py:703–718  ·  view source on GitHub ↗

Helper function to check subprocess.run returncode equals 0 If not raise AssertionError

(self, ret)

Source from the content-addressed store, hash-verified

701 return pathlib.Path("/")
702
703 def _check_retcode(self, ret):
704 """
705 Helper function to check subprocess.run returncode equals 0
706 If not raise AssertionError
707 """
708 if ret.returncode != 0:
709 log.error(ret)
710 # Provide better error message for Windows access violation
711 # 0xC0000005 as signed 32-bit integer is 3221225477
712 if platform.is_windows() and ret.returncode in (0xC0000005, 3221225477):
713 log.error(
714 "Windows installer crashed with access violation (0xC0000005). "
715 "This may indicate a file locking issue or that services weren't fully stopped."
716 )
717 assert ret.returncode == 0
718 return True
719
720 def _install_pkgs(self, upgrade=False, downgrade=False):
721 if downgrade:

Callers 9

_default_pkg_mngrMethod · 0.95
_install_pkgsMethod · 0.95
_install_ssm_serviceMethod · 0.95
stop_servicesMethod · 0.95
restart_servicesMethod · 0.95
install_previousMethod · 0.95
uninstallMethod · 0.95
write_systemd_confMethod · 0.95

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected