Пример #1
0
    def test_main(self):
        with mock.patch.object(agent, 'UnixDomainMetadataProxy') as proxy:
            with mock.patch.object(metadata_agent, 'config') as config:
                with mock.patch.object(metadata_agent, 'cfg') as cfg:
                    with mock.patch.object(utils, 'cfg'):
                        metadata_agent.main()

                        self.assertTrue(config.setup_logging.called)
                        proxy.assert_has_calls(
                            [mock.call(cfg.CONF),
                             mock.call().run()])
Пример #2
0
    def test_main(self):
        with mock.patch.object(agent, 'UnixDomainMetadataProxy') as proxy:
            with mock.patch.object(metadata_agent, 'config') as config:
                with mock.patch.object(metadata_agent, 'cfg') as cfg:
                    with mock.patch.object(utils, 'cfg'):
                        metadata_agent.main()

                        self.assertTrue(config.setup_logging.called)
                        proxy.assert_has_calls([
                            mock.call(cfg.CONF),
                            mock.call().run()]
                        )
Пример #3
0
def main():
    metadata_agent.main()
Пример #4
0
def main():
    metadata_agent.main()
Пример #5
0
def main():
    proctitle = "%s (%s)" % (constants.AGENT_PROCESS_METADATA,
                             setproctitle.getproctitle())
    setproctitle.setproctitle(proctitle)

    metadata_agent.main()