def test__does_log_other_exceptions_when_restarting(self):
self.patch_sudo_write_file()
self.patch_restartService().side_effect = (
factory.make_exception("DHCP is on strike today"))
failover_peers = [make_failover_peer_config()]
shared_networks = fix_shared_networks_failover(
[make_shared_network()], failover_peers)
with FakeLogger("maas") as logger:
with ExpectedException(exceptions.CannotConfigureDHCP):
yield self.configure(
factory.make_name('key'),
failover_peers, shared_networks,
[make_host()], [make_interface()],
make_global_dhcp_snippets())
self.assertDocTestMatches(
"DHCPv... server failed to restart: "
"DHCP is on strike today", logger.output)
评论列表
文章目录