|
1 --- neutron-2013.2.3/neutron/agent/dhcp_agent.py.orig 2014-04-03 11:49:01.000000000 -0700 |
|
2 +++ neutron-2013.2.3/neutron/agent/dhcp_agent.py 2014-05-29 14:07:12.811163548 -0700 |
|
3 @@ -3,6 +3,8 @@ |
|
4 # Copyright 2012 OpenStack Foundation |
|
5 # All Rights Reserved. |
|
6 # |
|
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. |
|
14 |
|
15 import os |
|
16 +import platform |
|
17 |
|
18 import eventlet |
|
19 import netaddr |
|
20 from oslo.config import cfg |
|
21 |
|
22 from neutron.agent.common import config |
|
23 -from neutron.agent.linux import dhcp |
|
24 from neutron.agent.linux import external_process |
|
25 -from neutron.agent.linux import interface |
|
26 from neutron.agent import rpc as agent_rpc |
|
27 from neutron.common import constants |
|
28 from neutron.common import exceptions |
|
29 @@ -42,6 +43,9 @@ |
|
30 from neutron import service as neutron_service |
|
31 |
|
32 LOG = logging.getLogger(__name__) |
|
33 +# dynamic module import |
|
34 +dhcp = None |
|
35 +interface = None |
|
36 |
|
37 |
|
38 class DhcpAgent(manager.Manager): |
|
39 @@ -602,6 +606,16 @@ |
|
40 cfg.CONF.register_opts(DhcpAgent.OPTS) |
|
41 config.register_agent_state_opts_helper(cfg.CONF) |
|
42 config.register_root_helper(cfg.CONF) |
|
43 + global dhcp |
|
44 + global interface |
|
45 + if platform.system() == "SunOS": |
|
46 + dhcp = importutils.import_module("neutron.agent.solaris.dhcp") |
|
47 + interface = \ |
|
48 + importutils.import_module("neutron.agent.solaris.interface") |
|
49 + else: |
|
50 + dhcp = importutils.import_module("neutron.agent.linux.dhcp") |
|
51 + interface = \ |
|
52 + importutils.import_module("neutron.agent.linux.interface") |
|
53 cfg.CONF.register_opts(dhcp.OPTS) |
|
54 cfg.CONF.register_opts(interface.OPTS) |
|
55 |
|
56 --- neutron-2013.2.3/neutron/db/dhcp_rpc_base.py.orig 2014-04-03 11:49:01.000000000 -0700 |
|
57 +++ neutron-2013.2.3/neutron/db/dhcp_rpc_base.py 2014-05-29 14:07:45.666828914 -0700 |
|
58 @@ -131,11 +131,13 @@ |
|
59 for fixed_ip in port['fixed_ips']: |
|
60 if fixed_ip['subnet_id'] in dhcp_enabled_subnet_ids: |
|
61 dhcp_enabled_subnet_ids.remove(fixed_ip['subnet_id']) |
|
62 - port['fixed_ips'].extend( |
|
63 - [dict(subnet_id=s) for s in dhcp_enabled_subnet_ids]) |
|
64 - |
|
65 - retval = plugin.update_port(context, port['id'], |
|
66 - dict(port=port)) |
|
67 + if dhcp_enabled_subnet_ids: |
|
68 + port['fixed_ips'].extend( |
|
69 + [dict(subnet_id=s) for s in dhcp_enabled_subnet_ids]) |
|
70 + retval = plugin.update_port(context, port['id'], |
|
71 + dict(port=port)) |
|
72 + else: |
|
73 + retval = port |
|
74 |
|
75 except n_exc.NotFound as e: |
|
76 LOG.warning(e) |