Пример #1
0
 def test_collect_all_store_softwareconfig(self):
     soft_config_map = {
         'ec2': {
             'requests_impl': test_ec2.FakeRequests
         },
         'cfn': {
             'requests_impl': test_cfn.FakeRequestsSoftwareConfig(self)
         },
         'heat': {
             'keystoneclient': test_heat.FakeKeystoneClient(self),
             'heatclient': test_heat.FakeHeatClient(self),
             'discover_class': test_heat.FakeKeystoneDiscover
         },
         'request': {
             'requests_impl': test_request.FakeRequests
         },
         'zaqar': {
             'keystoneclient': test_zaqar.FakeKeystoneClient(self),
             'zaqarclient': test_zaqar.FakeZaqarClient(self),
             'discover_class': test_heat.FakeKeystoneDiscover
         },
     }
     expected_changed = set(
         ('heat_local', 'ec2', 'cfn', 'heat', 'local', 'request',
          'dep-name1', 'dep-name2', 'dep-name3', 'zaqar'))
     self._test_collect_all_store(collector_kwargs_map=soft_config_map,
                                  expected_changed=expected_changed)
Пример #2
0
 def _call_main(self, fake_args):
     # make sure we don't run forever!
     if '--one-time' not in fake_args:
         fake_args.append('--one-time')
     collector_kwargs_map = {
         'ec2': {
             'requests_impl': test_ec2.FakeRequests
         },
         'cfn': {
             'requests_impl': test_cfn.FakeRequests(self)
         },
         'heat': {
             'keystoneclient': test_heat.FakeKeystoneClient(self),
             'heatclient': test_heat.FakeHeatClient(self),
             'discover_class': test_heat.FakeKeystoneDiscover
         },
         'request': {
             'requests_impl': test_request.FakeRequests
         },
         'zaqar': {
             'keystoneclient': test_zaqar.FakeKeystoneClient(self),
             'zaqarclient': test_zaqar.FakeZaqarClient(self),
             'discover_class': test_heat.FakeKeystoneDiscover
         },
     }
     with mock.patch.object(config_drive, 'get_metadata') as gm:
         gm.return_value = {}
         return collect.__main__(args=fake_args,
                                 collector_kwargs_map=collector_kwargs_map)
Пример #3
0
 def _call_collect_all(self,
                       store,
                       collector_kwargs_map=None,
                       collectors=None):
     if collector_kwargs_map is None:
         collector_kwargs_map = {
             'ec2': {
                 'requests_impl': test_ec2.FakeRequests
             },
             'cfn': {
                 'requests_impl': test_cfn.FakeRequests(self)
             },
             'heat': {
                 'keystoneclient': test_heat.FakeKeystoneClient(self),
                 'heatclient': test_heat.FakeHeatClient(self),
                 'discover_class': test_heat.FakeKeystoneDiscover
             },
             'request': {
                 'requests_impl': test_request.FakeRequests
             },
             'zaqar': {
                 'keystoneclient': test_zaqar.FakeKeystoneClient(self),
                 'zaqarclient': test_zaqar.FakeZaqarClient(self),
                 'discover_class': test_heat.FakeKeystoneDiscover
             },
         }
     if collectors is None:
         collectors = cfg.CONF.collectors
     with mock.patch.object(config_drive, 'get_metadata') as gm:
         gm.return_value = {}
         return collect.collect_all(
             collectors,
             store=store,
             collector_kwargs_map=collector_kwargs_map)