~ubuntu-branches/ubuntu/vivid/neutron/vivid-updates

« back to all changes in this revision

Viewing changes to neutron/plugins/mlnx/agent/eswitch_neutron_agent.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-03-30 11:17:19 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20150330111719-h0gx7233p4jkkgfh
Tags: 1:2015.1~b3-0ubuntu1
* New upstream milestone release:
  - d/control: Align version requirements with upstream.
  - d/control: Add new dependency on oslo-log.
  - d/p/*: Rebase.
  - d/control,d/neutron-plugin-hyperv*: Dropped, decomposed into
    separate project upstream.
  - d/control,d/neutron-plugin-openflow*: Dropped, decomposed into
    separate project upstream.
  - d/neutron-common.install: Add neutron-rootwrap-daemon and 
    neutron-keepalived-state-change binaries.
  - d/rules: Ignore neutron-hyperv-agent when installing; only for Windows.
  - d/neutron-plugin-cisco.install: Drop neutron-cisco-cfg-agent as
    decomposed into separate project upstream.
  - d/neutron-plugin-vmware.install: Drop neutron-check-nsx-config and
    neutron-nsx-manage as decomposed into separate project upstream.
  - d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent.
* d/pydist-overrides: Add overrides for oslo packages.
* d/control: Fixup type in package description (LP: #1263539).
* d/p/fixup-driver-test-execution.patch: Cherry pick fix from upstream VCS
  to support unit test exection in out-of-tree vendor drivers.
* d/neutron-common.postinst: Allow general access to /etc/neutron but limit
  access to root/neutron to /etc/neutron/neutron.conf to support execution
  of unit tests in decomposed vendor drivers.
* d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent
  package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2013 Mellanox Technologies, Ltd
2
 
#
3
 
# Licensed under the Apache License, Version 2.0 (the "License");
4
 
# you may not use this file except in compliance with the License.
5
 
# You may obtain a copy of the License at
6
 
#
7
 
#    http://www.apache.org/licenses/LICENSE-2.0
8
 
#
9
 
# Unless required by applicable law or agreed to in writing, software
10
 
# distributed under the License is distributed on an "AS IS" BASIS,
11
 
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
 
# implied.
13
 
# See the License for the specific language governing permissions and
14
 
# limitations under the License.
15
 
 
16
 
 
17
 
import sys
18
 
 
19
 
from networking_mlnx.plugins.mlnx.agent import mlnx_eswitch_neutron_agent
20
 
from oslo.config import cfg
21
 
 
22
 
from neutron.i18n import _LE, _LI
23
 
from neutron.common import config as common_config
24
 
from neutron.common import utils
25
 
from neutron.openstack.common import log as logging
26
 
from neutron.plugins.mlnx.agent import config  # noqa
27
 
 
28
 
LOG = logging.getLogger(__name__)
29
 
 
30
 
 
31
 
def main():
32
 
    common_config.init(sys.argv[1:])
33
 
    common_config.setup_logging()
34
 
 
35
 
    try:
36
 
        interface_mappings = utils.parse_mappings(
37
 
            cfg.CONF.ESWITCH.physical_interface_mappings)
38
 
    except ValueError as e:
39
 
        LOG.error(_LE("Parsing physical_interface_mappings failed: %s. "
40
 
                      "Agent terminated!"), e)
41
 
        sys.exit(1)
42
 
    LOG.info(_LI("Interface mappings: %s"), interface_mappings)
43
 
 
44
 
    root_helper = cfg.CONF.AGENT.root_helper
45
 
    try:
46
 
        agent = mlnx_eswitch_neutron_agent.MlnxEswitchNeutronAgent(
47
 
            interface_mappings, root_helper)
48
 
    except Exception as e:
49
 
        LOG.error(_LE("Failed on Agent initialisation : %s. "
50
 
                      "Agent terminated!"), e)
51
 
        sys.exit(1)
52
 
 
53
 
    # Start everything.
54
 
    LOG.info(_LI("Agent initialised successfully, now running... "))
55
 
    agent.run()
56
 
    sys.exit(0)
57
 
 
58
 
 
59
 
if __name__ == '__main__':
60
 
    main()