1
# Copyright 2013 Mellanox Technologies, Ltd
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
7
# http://www.apache.org/licenses/LICENSE-2.0
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
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
19
from networking_mlnx.plugins.mlnx.agent import mlnx_eswitch_neutron_agent
20
from oslo.config import cfg
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
28
LOG = logging.getLogger(__name__)
32
common_config.init(sys.argv[1:])
33
common_config.setup_logging()
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)
42
LOG.info(_LI("Interface mappings: %s"), interface_mappings)
44
root_helper = cfg.CONF.AGENT.root_helper
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)
54
LOG.info(_LI("Agent initialised successfully, now running... "))
59
if __name__ == '__main__':