MCPcopy
hub / github.com/zalando/spilo / get_binary_version

Function get_binary_version

postgres-appliance/scripts/spilo_commons.py:52–56  ·  view source on GitHub ↗
(bin_dir)

Source from the content-addressed store, hash-verified

50
51
52def get_binary_version(bin_dir):
53 postgres = os.path.join(bin_dir or '', 'postgres')
54 version = subprocess.check_output([postgres, '--version']).decode()
55 version = re.match(r'^[^\s]+ [^\s]+ (\d+)(\.(\d+))?', version)
56 return '.'.join([version.group(1), version.group(3)]) if int(version.group(1)) < 10 else version.group(1)
57
58
59def get_bin_dir(version):

Callers 4

mainFunction · 0.90
get_desired_versionMethod · 0.90
get_possible_versionsFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected