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

Function __get_version

salt/version.py:682–695  ·  view source on GitHub ↗

If we can get a version provided at installation time or from Git, use that instead, otherwise we carry on.

(saltstack_version)

Source from the content-addressed store, hash-verified

680
681
682def __get_version(saltstack_version):
683 """
684 If we can get a version provided at installation time or from Git, use
685 that instead, otherwise we carry on.
686 """
687 _hardcoded_version_file = os.path.join(
688 os.path.dirname(os.path.abspath(__file__)), "_version.txt"
689 )
690 if not os.path.exists(_hardcoded_version_file):
691 return __discover_version(saltstack_version)
692 with open( # pylint: disable=resource-leakage
693 _hardcoded_version_file, encoding="utf-8"
694 ) as rfh:
695 return SaltStackVersion.parse(rfh.read().strip())
696
697
698# Get additional version information if available

Callers 1

version.pyFile · 0.85

Calls 5

__discover_versionFunction · 0.85
openFunction · 0.50
existsMethod · 0.45
parseMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected