Merge "Stop the dhcp-agent process when dnsmasq version is not determined"

This commit is contained in:
Jenkins 2014-07-01 18:08:17 +00:00 committed by Gerrit Code Review
commit b7bf77cc86
2 changed files with 7 additions and 4 deletions

View File

@ -318,9 +318,10 @@ class Dnsmasq(DhcpLocalProcess):
'Please ensure that its version is %s '
'or above!'), cls.MINIMUM_VERSION)
except (OSError, RuntimeError, IndexError, ValueError):
LOG.warning(_('Unable to determine dnsmasq version. '
'Please ensure that its version is %s '
'or above!'), cls.MINIMUM_VERSION)
LOG.error(_('Unable to determine dnsmasq version. '
'Please ensure that its version is %s '
'or above!'), cls.MINIMUM_VERSION)
raise SystemExit(1)
return float(ver)
@classmethod

View File

@ -18,6 +18,7 @@ import os
import mock
from oslo.config import cfg
import testtools
from neutron.agent.common import config
from neutron.agent.linux import dhcp
@ -1284,7 +1285,8 @@ tag:tag0,option:router""".lstrip()
float(2.48))
def test_check_version_failed_cmd_execution(self):
self._check_version('Error while executing command', 0)
with testtools.ExpectedException(SystemExit):
self._check_version('Error while executing command', 0)
def test_only_populates_dhcp_enabled_subnets(self):
exp_host_name = '/dhcp/eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee/host'