def test_keystone_joined_url_override(self, _config, mock_config,
                                       _is_clustered, _unit_get):
     _unit_get.return_value = "thishost"
     _is_clustered.return_value = False
     _config.side_effect = self.test_config.get
     mock_config.side_effect = self.test_config.get
     self.test_config.set('region', 'myregion')
     self.test_config.set('os-public-hostname', 'ceilometer.example.com')
     hooks.keystone_joined(None)
     url = "http://{}:{}".format('thishost', hooks.CEILOMETER_PORT)
     public_url = "http://{}:{}".format('ceilometer.example.com',
                                        hooks.CEILOMETER_PORT)
     self.relation_set.assert_called_with(
         service=hooks.CEILOMETER_SERVICE,
         public_url=public_url, admin_url=url, internal_url=url,
         requested_roles=hooks.CEILOMETER_ROLE,
         region='myregion', relation_id=None)
 def test_keystone_joined_url_override(self, _config, mock_config,
                                       _is_clustered, _unit_get):
     _unit_get.return_value = "thishost"
     _is_clustered.return_value = False
     _config.side_effect = self.test_config.get
     mock_config.side_effect = self.test_config.get
     self.test_config.set('region', 'myregion')
     self.test_config.set('os-public-hostname', 'ceilometer.example.com')
     hooks.keystone_joined(None)
     url = "http://{}:{}".format('thishost', hooks.CEILOMETER_PORT)
     public_url = "http://{}:{}".format('ceilometer.example.com',
                                        hooks.CEILOMETER_PORT)
     self.relation_set.assert_called_with(
         service=hooks.CEILOMETER_SERVICE,
         public_url=public_url, admin_url=url, internal_url=url,
         requested_roles=hooks.CEILOMETER_ROLE,
         region='myregion', relation_id=None)
Ejemplo n.º 3
0
 def test_keystone_joined_partial_cluster(self):
     self.is_clustered.return_value = False
     self.test_config.set('vip', '10.0.0.10')
     hooks.keystone_joined()
     self.assertFalse(self.relation_set.called)