components/openstack/nova/patches/10-launchpad-1486590.patch
changeset 6854 52081f923019
parent 6853 cf1567491b1b
child 6855 ea44e7e0ca98
equal deleted inserted replaced
6853:cf1567491b1b 6854:52081f923019
     1 This patch has been integrated into Nova 11.0.0 in Liberty but has not
       
     2 yet been back-ported to Kilo.
       
     3 
       
     4 From 9095b364bd8fb1e4f282d7aca44825eca1243b53 Mon Sep 17 00:00:00 2001
       
     5 From: Davanum Srinivas <[email protected]>
       
     6 Date: Tue, 18 Aug 2015 22:26:36 -0400
       
     7 Subject: Expose keystoneclient's session and auth plugin loading parameters
       
     8 
       
     9 In change id (I7b3b825737dde333c8d88019d814304cbefdbfc7) support
       
    10 was added to be able to specify and use the standard session and
       
    11 auth plugin helpers from keystoneclient to standardize the
       
    12 options available for talking to neutron.
       
    13 
       
    14 However, these config options do not show up when we generate
       
    15 the sample configuration file. Jamie Lennox has details in his
       
    16 blog as well:
       
    17 http://www.jamielennox.net/blog/2015/02/17/loading-authentication-plugins/
       
    18 
       
    19 Since there are many auth plugins, we generate config params for
       
    20 a few common ones.
       
    21 
       
    22 DocImpact
       
    23 
       
    24 Closes-Bug: #1486590
       
    25 Change-Id: Id6b3ff845c2388fa01b1d3b28093f5bdf27136ff
       
    26 ---
       
    27 
       
    28 --- nova-2015.1.2/nova/network/neutronv2/api.py.orig	2015-10-13 07:52:44.000000000 -0700
       
    29 +++ nova-2015.1.2/nova/network/neutronv2/api.py	2016-01-05 22:35:48.184784998 -0800
       
    30 @@ -15,6 +15,7 @@
       
    31  #    under the License.
       
    32  #
       
    33  
       
    34 +import copy
       
    35  import time
       
    36  import uuid
       
    37  
       
    38 @@ -123,8 +124,8 @@ deprecations = {'cafile': [cfg.Deprecate
       
    39                  'timeout': [cfg.DeprecatedOpt('url_timeout',
       
    40                                                group=NEUTRON_GROUP)]}
       
    41  
       
    42 -session.Session.register_conf_options(CONF, NEUTRON_GROUP,
       
    43 -                                      deprecated_opts=deprecations)
       
    44 +_neutron_options = session.Session.register_conf_options(
       
    45 +    CONF, NEUTRON_GROUP, deprecated_opts=deprecations)
       
    46  auth.register_conf_options(CONF, NEUTRON_GROUP)
       
    47  
       
    48  
       
    49 @@ -139,6 +140,25 @@ _SESSION = None
       
    50  _ADMIN_AUTH = None
       
    51  
       
    52  
       
    53 +def list_opts():
       
    54 +    list = copy.deepcopy(_neutron_options)
       
    55 +    list.insert(0, auth.get_common_conf_options()[0])
       
    56 +    # NOTE(dims): There are a lot of auth plugins, we just generate
       
    57 +    # the config options for a few common ones
       
    58 +    plugins = ['password', 'v2password', 'v3password']
       
    59 +    for name in plugins:
       
    60 +        for plugin_option in auth.get_plugin_class(name).get_options():
       
    61 +            found = False
       
    62 +            for option in list:
       
    63 +                if option.name == plugin_option.name:
       
    64 +                    found = True
       
    65 +                    break
       
    66 +            if not found:
       
    67 +                list.append(plugin_option)
       
    68 +    list.sort(key=lambda x: x.name)
       
    69 +    return [(NEUTRON_GROUP, list)]
       
    70 +
       
    71 +
       
    72  def reset_state():
       
    73      global _ADMIN_AUTH
       
    74      global _SESSION