Fixed binary path issue on Windows platform. refs #5370

This commit is contained in:
Akshay Joshi 2021-06-14 15:01:49 +05:30
parent 09693d14d1
commit 2fdde6218a
2 changed files with 4 additions and 7 deletions

View File

@ -200,12 +200,10 @@ def validate_binary_path():
(utility if os.name != 'nt' else
(utility + '.exe'))))
# Replace the spaces with '\'
full_path = full_path.replace(" ", "\\ ")
try:
# Get the output of the '--version' command
version_string = subprocess.getoutput(full_path + ' --version')
version_string = \
subprocess.getoutput('"{0}" --version'.format(full_path))
# Get the version number by splitting the result string
version_string.split(") ", 1)[1].split('.', 1)[0]
except Exception:

View File

@ -309,14 +309,13 @@ def set_binary_path(binary_path, bin_paths, server_type,
full_path = os.path.abspath(
os.path.join(binary_path, (utility if os.name != 'nt' else
(utility + '.exe'))))
# Replace the spaces with '\'
full_path = full_path.replace(" ", "\\ ")
try:
# if version_number is provided then no need to fetch it.
if version_number is None:
# Get the output of the '--version' command
version_string = subprocess.getoutput(full_path + ' --version')
version_string = \
subprocess.getoutput('"{0}" --version'.format(full_path))
# Get the version number by splitting the result string
version_number = \