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

Method install

tests/support/pkg.py:993–1025  ·  view source on GitHub ↗
(self, upgrade=False, downgrade=False, stop_services=True)

Source from the content-addressed store, hash-verified

991 ).stdout.strip()
992
993 def install(self, upgrade=False, downgrade=False, stop_services=True):
994 self._install_pkgs(upgrade=upgrade, downgrade=downgrade)
995 if platform.is_darwin():
996 self._refresh_macos_binary_paths()
997 self.update_process_path()
998 if stop_services:
999 # The Salt .pkg loads ``com.saltstack.salt.minion`` (and on
1000 # some installs also ``master``/``api``/``syndic``) at install
1001 # time via ``RunAtLoad=true``. Those daemons start with the
1002 # default minion config (``master: salt``, which does not
1003 # resolve), so they never authenticate to the test fixture's
1004 # master. Worse, saltfactories' ``PkgLaunchdSaltDaemonImpl``
1005 # checks the plist label when its own ``salt_minion`` fixture
1006 # tries to ``launchctl bootstrap`` -- sees the auto-loaded
1007 # daemon, declares the test minion "already running", and
1008 # silently uses the misconfigured launchd-managed process
1009 # instead. Fan-out then finds zero connected minions and
1010 # ``api_request`` returns ``{'return': [{}]}``.
1011 # Bootout the auto-installed daemons here so the label is
1012 # free when the test fixture brings up its own.
1013 self._stop_macos_pkg_daemons()
1014 if self.distro_id in ("ubuntu", "debian") and stop_services:
1015 self.stop_services()
1016 elif (
1017 upgrade
1018 and self.pkg_system_service
1019 and not platform.is_windows()
1020 and not platform.is_darwin()
1021 ):
1022 # RPM/DEB upgrade replaces on disk while systemd units can keep old
1023 # processes until restart; ``salt-call --local test.version`` then
1024 # still reports the previous release (see upgrade systemd teardown).
1025 self.restart_services()
1026
1027 def _stop_macos_pkg_daemons(self):
1028 """

Callers 15

__enter__Method · 0.95
test_wheelFunction · 0.45
test_eggFunction · 0.45
test_sdistFunction · 0.45
test_setup_installFunction · 0.45
venvFunction · 0.45
test_compare_versionsFunction · 0.45
salt_systemd_setupFunction · 0.45
salt_systemd_setupFunction · 0.45
salt_test_upgradeFunction · 0.45

Calls 6

_install_pkgsMethod · 0.95
update_process_pathMethod · 0.95
stop_servicesMethod · 0.95
restart_servicesMethod · 0.95

Tested by 15

test_wheelFunction · 0.36
test_eggFunction · 0.36
test_sdistFunction · 0.36
test_setup_installFunction · 0.36
venvFunction · 0.36
test_compare_versionsFunction · 0.36
salt_systemd_setupFunction · 0.36
salt_systemd_setupFunction · 0.36
salt_test_upgradeFunction · 0.36