Exemple #1
0
    def get_neutron_info(self):
        neutron_info = h.HashableDict()
        neutron_info['network'] = (
            self.instance.node_group.cluster.neutron_management_network)
        ctx = context.current()
        neutron_info['uri'] = base.url_for(ctx.service_catalog, 'network')
        neutron_info['token'] = ctx.token
        neutron_info['tenant'] = ctx.tenant_name
        neutron_info['host'] = self.instance.management_ip

        LOG.debug('Returning neutron info: {0}'.format(neutron_info))
        return neutron_info
Exemple #2
0
    def get_neutron_info(self, instance=None):
        if not instance:
            instance = self.instance
        neutron_info = h.HashableDict()
        neutron_info['network'] = instance.cluster.neutron_management_network
        ctx = context.current()
        neutron_info['uri'] = base.url_for(ctx.service_catalog, 'network')
        neutron_info['token'] = ctx.auth_token
        neutron_info['tenant'] = ctx.tenant_name
        neutron_info['host'] = instance.management_ip

        LOG.debug('Returning neutron info: {0}'.format(neutron_info))
        return neutron_info
 def test_hash_consistency(self):
     dct1 = h.HashableDict(one='oneValue')
     dct2 = h.HashableDict(one='oneValue')
     self.assertEqual(hash(dct1), hash(dct2))
Exemple #4
0
    def test_is_hashable(self):
        hd = h.HashableDict()
        hd['one'] = 'oneValue'

        self.assertTrue(isinstance(hd, collections.Hashable))
 def test_is_hashable_collection(self):
     dct = h.HashableDict(one='oneValue')
     self.assertIsInstance(dct, collections.Hashable)