components/openstack/neutron/patches/02-l3-agent-add-solaris.patch
changeset 5405 66fd59fecd68
parent 3998 5bd484384122
child 6031 1aaf20a19738
equal deleted inserted replaced
5404:55e409ba4e72 5405:66fd59fecd68
     1 *** neutron-2014.2.2/neutron/agent/l3_agent.py	2015-02-05 07:45:33.000000000 -0800
     1 Changes to the Neutron L3 agent to port it to Solaris. These changes
     2 --- NEW/neutron/agent/l3_agent.py	2015-02-06 11:10:53.164349168 -0800
     2 will eventually be proposed upstream.
     3 ***************
     3 
     4 *** 1,5 ****
     4 --- neutron-2015.1.2/neutron/agent/l3_agent.py.~1~	2015-10-13 10:35:16.000000000 -0700
     5 --- 1,7 ----
     5 +++ neutron-2015.1.2/neutron/agent/l3_agent.py	2016-01-28 23:07:42.233773807 -0800
     6   # Copyright 2012 VMware, Inc.  All rights reserved.
     6 @@ -14,6 +14,7 @@
     7   #
     7  #    License for the specific language governing permissions and limitations
     8 + # Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
     8  #    under the License.
     9 + #
     9  
    10   #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    10 +import platform
    11   #    not use this file except in compliance with the License. You may obtain
    11  import sys
    12   #    a copy of the License at
    12  
    13 ***************
    13  from oslo_config import cfg
    14 *** 13,18 ****
    14 @@ -46,6 +47,8 @@ def main(manager='neutron.agent.l3.agent
    15 --- 15,21 ----
    15      register_opts(cfg.CONF)
    16   #    under the License.
    16      common_config.init(sys.argv[1:])
    17   #
    17      config.setup_logging()
    18   
    18 +    if platform.system() == "SunOS":
    19 + import platform
    19 +        manager = 'neutron.agent.evs_l3_agent.EVSL3NATAgent'
    20   import sys
    20      server = neutron_service.Service.create(
    21   
    21          binary='neutron-l3-agent',
    22   import datetime
    22          topic=topics.L3_AGENT,
    23 ***************
    23 --- neutron-2015.1.2/neutron/agent/linux/daemon.py.~1~	2015-10-13 10:35:16.000000000 -0700
    24 *** 33,38 ****
    24 +++ neutron-2015.1.2/neutron/agent/linux/daemon.py	2016-01-28 23:07:42.234372590 -0800
    25 --- 36,42 ----
    25 @@ -18,12 +18,14 @@ import grp
    26   from neutron.agent.linux import iptables_manager
    26  import logging as std_logging
    27   from neutron.agent.linux import ra
    27  from logging import handlers
    28   from neutron.agent import rpc as agent_rpc
    28  import os
    29 + from neutron.agent.solaris import ipfilters_manager
    29 +import platform
    30   from neutron.common import config as common_config
    30  import pwd
    31   from neutron.common import constants as l3_constants
    31  import signal
    32   from neutron.common import ipv6_utils
    32  import sys
    33 ***************
    33  
    34 *** 257,266 ****
    34  from oslo_log import log as logging
    35           # Invoke the setter for establishing initial SNAT action
    35  
    36           self.router = router
    36 +from neutron.agent.linux import utils
    37           self.ns_name = NS_PREFIX + router_id if use_namespaces else None
    37  from neutron.common import exceptions
    38 !         self.iptables_manager = iptables_manager.IptablesManager(
    38  from neutron.i18n import _LE, _LI
    39 !             root_helper=root_helper,
    39  
    40 !             use_ipv6=use_ipv6,
    40 @@ -140,6 +142,15 @@ class Pidfile(object):
    41 !             namespace=self.ns_name)
    41          if not pid:
    42           self.snat_iptables_manager = None
    42              return False
    43           self.routes = []
    43  
    44           # DVR Data
    44 +        if platform.system() == "SunOS":
    45 --- 261,274 ----
    45 +            cmd = ['/usr/bin/pargs', pid]
    46           # Invoke the setter for establishing initial SNAT action
    46 +            try:
    47           self.router = router
    47 +                exec_out = utils.execute(cmd)
    48           self.ns_name = NS_PREFIX + router_id if use_namespaces else None
    48 +            except RuntimeError:
    49 !         if platform.system() == "SunOS":
    49 +                return False
    50 !             self.ipfilters_manager = ipfilters_manager.IPfiltersManager()
    50 +            return self.procname in exec_out and (not self.uuid or
    51 !             self.iptables_manager = None
    51 +                                                  self.uuid in exec_out)
    52 !         else:
    52 +
    53 !             self.iptables_manager = iptables_manager.IptablesManager(
    53          cmdline = '/proc/%s/cmdline' % pid
    54 !                 root_helper=root_helper,
    54          try:
    55 !                 use_ipv6=use_ipv6,
    55              with open(cmdline, "r") as f:
    56 !                 namespace=self.ns_name)
    56 --- neutron-2015.1.2/neutron/common/ipv6_utils.py.~1~	2015-10-13 10:35:16.000000000 -0700
    57           self.snat_iptables_manager = None
    57 +++ neutron-2015.1.2/neutron/common/ipv6_utils.py	2016-01-28 23:28:34.771113032 -0800
    58           self.routes = []
    58 @@ -17,6 +17,7 @@
    59           # DVR Data
    59  IPv6-related utilities and helper functions.
    60 ***************
    60  """
    61 *** 2049,2054 ****
    61  import os
    62 --- 2057,2064 ----
    62 +import platform
    63       _register_opts(cfg.CONF)
    63  
    64       common_config.init(sys.argv[1:])
    64  import netaddr
    65       config.setup_logging()
    65  from oslo_log import log
    66 +     if platform.system() == "SunOS":
    66 @@ -51,6 +52,11 @@ def get_ipv6_addr_by_EUI64(prefix, mac):
    67 +         manager = 'neutron.agent.evs_l3_agent.EVSL3NATAgent'
    67  def is_enabled():
    68       server = neutron_service.Service.create(
    68      global _IS_IPV6_ENABLED
    69           binary='neutron-l3-agent',
    69  
    70           topic=topics.L3_AGENT,
    70 +    if platform.system() == "SunOS":
       
    71 +        if _IS_IPV6_ENABLED is None:
       
    72 +            _IS_IPV6_ENABLED = True
       
    73 +        return _IS_IPV6_ENABLED
       
    74 +
       
    75      if _IS_IPV6_ENABLED is None:
       
    76          disabled_ipv6_path = "/proc/sys/net/ipv6/conf/default/disable_ipv6"
       
    77          if os.path.exists(disabled_ipv6_path):