self.external_process_p.stop()
ri = l3router.RouterInfo(router_id, None, None)
- try:
- with mock.patch(ip_class_path) as ip_mock:
- self.agent._spawn_metadata_proxy(ri.router_id, ri.ns_name)
- ip_mock.assert_has_calls([
- mock.call('sudo', ri.ns_name),
- mock.call().netns.execute([
- 'neutron-ns-metadata-proxy',
- mock.ANY,
- mock.ANY,
- '--router_id=%s' % router_id,
- mock.ANY,
- '--metadata_port=%s' % metadata_port,
- '--debug',
- '--log-file=neutron-ns-metadata-proxy-%s.log' %
- router_id
- ], addl_env=None)
- ])
- finally:
- self.external_process_p.start()
+ with mock.patch(ip_class_path) as ip_mock:
+ self.agent._spawn_metadata_proxy(ri.router_id, ri.ns_name)
+ ip_mock.assert_has_calls([
+ mock.call('sudo', ri.ns_name),
+ mock.call().netns.execute([
+ 'neutron-ns-metadata-proxy',
+ mock.ANY,
+ mock.ANY,
+ '--router_id=%s' % router_id,
+ mock.ANY,
+ '--metadata_port=%s' % metadata_port,
+ '--debug',
+ '--log-file=neutron-ns-metadata-proxy-%s.log' %
+ router_id
+ ], addl_env=None)
+ ])