~ionutbalutoiu/charms/trusty/neutron-api/next

« back to all changes in this revision

Viewing changes to hooks/neutron_api_hooks.py

  • Committer: Liam Young
  • Date: 2014-06-17 09:48:24 UTC
  • Revision ID: liam.young@canonical.com-20140617094824-0pynps6kou6ake7s
Minor bug fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    restart_map,
43
43
    NEUTRON_CONF,
44
44
    api_port,
45
 
    auth_token_config,
46
45
    keystone_ca_cert_b64,
47
46
    CLUSTER_RES,
48
47
)
137
136
        # DB config might have been moved to main neutron.conf in H?
138
137
        CONFIGS.write(neutron_plugin_attribute(plugin, 'config'))
139
138
 
140
 
def _auth_config():
141
 
    '''Grab all KS auth token config from api-paste.ini, or return empty {}'''
142
 
    ks_auth_host = auth_token_config('auth_host')
143
 
    if not ks_auth_host:
144
 
        # if there is no auth_host set, identity-service changed hooks
145
 
        # have not fired, yet.
146
 
        return {}
147
 
    cfg = {
148
 
        'auth_host': ks_auth_host,
149
 
        'auth_port': auth_token_config('auth_port'),
150
 
        'auth_protocol': auth_token_config('auth_protocol'),
151
 
        'service_protocol': auth_token_config('service_protocol'),
152
 
        'service_port': auth_token_config('service_port'),
153
 
        'service_username': auth_token_config('admin_user'),
154
 
        'service_password': auth_token_config('admin_password'),
155
 
        'service_tenant_name': auth_token_config('admin_tenant_name'),
156
 
        'auth_uri': auth_token_config('auth_uri'),
157
 
        # quantum-gateway interface deviates a bit.
158
 
        'keystone_host': ks_auth_host,
159
 
        'service_tenant': auth_token_config('admin_tenant_name'),
160
 
    }
161
 
    return cfg
162
 
 
163
 
 
164
139
@hooks.hook('amqp-relation-broken',
165
140
            'identity-service-relation-broken',
166
141
            'shared-db-relation-broken',