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

« back to all changes in this revision

Viewing changes to hooks/neutron_api_utils.py

  • Committer: Liam Young
  • Date: 2014-06-11 09:10:54 UTC
  • Revision ID: liam.young@canonical.com-20140611091054-qkw6g1bsl9efm1i8
Remove ovs plugin support as this is going to be baked into charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                     neutron_api_context.NeutronPostgresqlDBContext(),
58
58
                     neutron_api_context.IdentityServiceContext(),
59
59
                     neutron_api_context.NeutronCCContext(),
60
 
                     context.SyslogContext(),
61
 
                     context.SubordinateConfigContext(
62
 
                         interface='neutron-plugin',
63
 
                         service='neutron',
64
 
                         config_file=NEUTRON_CONF)],
 
60
                     context.SyslogContext()],
65
61
    }),
66
62
    (NEUTRON_DEFAULT, {
67
63
        'services': ['neutron-server'],
68
 
        'contexts': [context.SubordinateConfigContext(
69
 
                         interface='neutron-plugin',
70
 
                         service='neutron',
71
 
                         config_file=NEUTRON_DEFAULT)],
 
64
        'contexts': [neutron_api_context.NeutronCCContext()],
72
65
    }),
73
66
])
74
67
def api_port(service):
122
115
    '''
123
116
    resource_map = deepcopy(BASE_RESOURCE_MAP)
124
117
 
 
118
    net_manager = network_manager()
 
119
 
 
120
    # add neutron plugin requirements. nova-c-c only needs the neutron-server
 
121
    # associated with configs, not the plugin agent.
 
122
    plugin = config('neutron-plugin')
 
123
    conf = neutron_plugin_attribute(plugin, 'config', net_manager)
 
124
    ctxts = (neutron_plugin_attribute(plugin, 'contexts', net_manager)
 
125
             or [])
 
126
    services = neutron_plugin_attribute(plugin, 'server_services',
 
127
                                        net_manager)
 
128
    resource_map[conf] = {}
 
129
    resource_map[conf]['services'] = services
 
130
    resource_map[conf]['contexts'] = ctxts
 
131
    resource_map[conf]['contexts'].append(
 
132
        neutron_api_context.NeutronCCContext())
 
133
 
 
134
    # update for postgres
 
135
    resource_map[conf]['contexts'].append(
 
136
        neutron_api_context.NeutronPostgresqlDBContext())
 
137
 
125
138
    return resource_map
126
139
 
127
140
 
128
141
def register_configs(release=None):
129
 
    release = release or os_release('neutron-common')
 
142
    release = release or os_release('nova-common')
130
143
    configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
131
144
                                          openstack_release=release)
132
145
    for cfg, rscs in resource_map().iteritems():