Set locale before check dnsmasq version
In some locale settings, cmd "dnsmasq --version" returns unexpected result even when dnsmasq is the right version. This fix sets env variable as "LC_ALL=C" to make sure dnsmasq version check returns correct result. Change-Id: I3d1c7793632f2c62e7b54e250e052de15f978e59 Closes-Bug:1412738
This commit is contained in:
@@ -144,7 +144,8 @@ def get_minimal_dnsmasq_version_supported():
|
||||
def dnsmasq_version_supported():
|
||||
try:
|
||||
cmd = ['dnsmasq', '--version']
|
||||
out = agent_utils.execute(cmd)
|
||||
env = {'LC_ALL': 'C'}
|
||||
out = agent_utils.execute(cmd, addl_env=env)
|
||||
m = re.search(r"version (\d+\.\d+)", out)
|
||||
ver = float(m.group(1)) if m else 0
|
||||
if ver < MINIMUM_DNSMASQ_VERSION:
|
||||
|
||||
Reference in New Issue
Block a user