1 --- neutron-2013.2.3/neutron/agent/dhcp_agent.py.orig 2014-04-03 11:49:01.000000000 -0700 |
1 Changes to the Neutron DHCP agent to port it to Solaris. These changes |
2 +++ neutron-2013.2.3/neutron/agent/dhcp_agent.py 2014-05-29 14:07:12.811163548 -0700 |
2 will eventually be proposed upstream. |
3 @@ -3,6 +3,8 @@ |
3 |
4 # Copyright 2012 OpenStack Foundation |
4 --- neutron-2014.2.2/neutron/agent/dhcp_agent.py.~1~ 2015-02-05 07:45:33.000000000 -0800 |
5 # All Rights Reserved. |
5 +++ neutron-2014.2.2/neutron/agent/dhcp_agent.py 2015-02-25 00:44:00.464466509 -0800 |
6 # |
6 @@ -14,6 +14,7 @@ |
7 +# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
|
8 +# |
|
9 # Licensed under the Apache License, Version 2.0 (the "License"); you may |
|
10 # not use this file except in compliance with the License. You may obtain |
|
11 # a copy of the License at |
|
12 @@ -16,15 +18,14 @@ |
|
13 # under the License. |
7 # under the License. |
14 |
8 |
15 import os |
9 import os |
16 +import platform |
10 +import platform |
|
11 import sys |
17 |
12 |
18 import eventlet |
13 import eventlet |
19 import netaddr |
14 @@ -22,9 +23,7 @@ eventlet.monkey_patch() |
20 from oslo.config import cfg |
15 from oslo.config import cfg |
21 |
16 |
22 from neutron.agent.common import config |
17 from neutron.agent.common import config |
23 -from neutron.agent.linux import dhcp |
18 -from neutron.agent.linux import dhcp |
24 from neutron.agent.linux import external_process |
19 from neutron.agent.linux import external_process |
25 -from neutron.agent.linux import interface |
20 -from neutron.agent.linux import interface |
|
21 from neutron.agent.linux import ovs_lib # noqa |
26 from neutron.agent import rpc as agent_rpc |
22 from neutron.agent import rpc as agent_rpc |
27 from neutron.common import constants |
23 from neutron.common import config as common_config |
28 from neutron.common import exceptions |
24 @@ -42,6 +41,9 @@ from neutron.openstack.common import ser |
29 @@ -42,6 +43,9 @@ |
|
30 from neutron import service as neutron_service |
25 from neutron import service as neutron_service |
31 |
26 |
32 LOG = logging.getLogger(__name__) |
27 LOG = logging.getLogger(__name__) |
33 +# dynamic module import |
28 +# dynamic module import |
34 +dhcp = None |
29 +dhcp = None |
35 +interface = None |
30 +interface = None |
36 |
31 |
37 |
32 |
38 class DhcpAgent(manager.Manager): |
33 class DhcpAgent(manager.Manager): |
39 @@ -602,6 +606,16 @@ |
34 @@ -609,6 +611,16 @@ def register_options(): |
40 cfg.CONF.register_opts(DhcpAgent.OPTS) |
35 config.register_use_namespaces_opts_helper(cfg.CONF) |
41 config.register_agent_state_opts_helper(cfg.CONF) |
36 config.register_agent_state_opts_helper(cfg.CONF) |
42 config.register_root_helper(cfg.CONF) |
37 config.register_root_helper(cfg.CONF) |
43 + global dhcp |
38 + global dhcp |
44 + global interface |
39 + global interface |
45 + if platform.system() == "SunOS": |
40 + if platform.system() == "SunOS": |
51 + interface = \ |
46 + interface = \ |
52 + importutils.import_module("neutron.agent.linux.interface") |
47 + importutils.import_module("neutron.agent.linux.interface") |
53 cfg.CONF.register_opts(dhcp.OPTS) |
48 cfg.CONF.register_opts(dhcp.OPTS) |
54 cfg.CONF.register_opts(interface.OPTS) |
49 cfg.CONF.register_opts(interface.OPTS) |
55 |
50 |
56 --- neutron-2013.2.3/neutron/db/dhcp_rpc_base.py.orig 2014-04-03 11:49:01.000000000 -0700 |
51 --- neutron-2014.2.2/neutron/api/rpc/handlers/dhcp_rpc.py.~1~ 2015-02-05 07:45:33.000000000 -0800 |
57 +++ neutron-2013.2.3/neutron/db/dhcp_rpc_base.py 2014-05-29 14:07:45.666828914 -0700 |
52 +++ neutron-2014.2.2/neutron/api/rpc/handlers/dhcp_rpc.py 2015-02-25 00:44:00.464738154 -0800 |
58 @@ -131,11 +131,13 @@ |
53 @@ -168,11 +168,13 @@ class DhcpRpcCallback(n_rpc.RpcCallback) |
59 for fixed_ip in port['fixed_ips']: |
54 for fixed_ip in port['fixed_ips']: |
60 if fixed_ip['subnet_id'] in dhcp_enabled_subnet_ids: |
55 if fixed_ip['subnet_id'] in dhcp_enabled_subnet_ids: |
61 dhcp_enabled_subnet_ids.remove(fixed_ip['subnet_id']) |
56 dhcp_enabled_subnet_ids.remove(fixed_ip['subnet_id']) |
62 - port['fixed_ips'].extend( |
57 - port['fixed_ips'].extend( |
63 - [dict(subnet_id=s) for s in dhcp_enabled_subnet_ids]) |
58 - [dict(subnet_id=s) for s in dhcp_enabled_subnet_ids]) |