Rename the 'SAHARA_AUTO_IP_ALLOCATION_ENABLED' config parameter

The 'SAHARA_AUTO_IP_ALLOCATION_ENABLED' config parameter in Sahara
is confusing. If you wish to disable floating IP options during node
group template creation, set it 'True', but this name sounds like it
has to do with automatically associating a floating IP. So this patch
renames it to a meaningful variable name.

Change-Id: If8f71ea21cb71bbffe996f7db88b7683ad91ecac
This commit is contained in:
qiaomin 2018-01-04 15:02:41 +08:00 committed by Allen
parent f91efd6ad9
commit fcdc776981
3 changed files with 19 additions and 5 deletions

View File

@ -0,0 +1,9 @@
---
prelude: >
The config parameter 'SAHARA_FLOATING_IP_DISABLED' replaces
'SAHARA_AUTO_IP_ALLOCATION_ENABLED'.
deprecations:
- |
The 'SAHARA_AUTO_IP_ALLOCATION_ENABLED' config parameter in Sahara
was deprecated and replaced by 'SAHARA_FLOATING_IP_DISABLED'
which has a less confusing name.

View File

@ -29,10 +29,15 @@ SAHARA_SERVICE = 'data-processing'
# Sahara service_type registered in Juno
SAHARA_SERVICE_FALLBACK = 'data_processing'
SAHARA_AUTO_IP_ALLOCATION_ENABLED = getattr(
settings,
'SAHARA_AUTO_IP_ALLOCATION_ENABLED',
False)
try:
SAHARA_FLOATING_IP_DISABLED = getattr(
settings,
'SAHARA_FLOATING_IP_DISABLED')
except AttributeError:
SAHARA_FLOATING_IP_DISABLED = getattr(
settings,
'SAHARA_AUTO_IP_ALLOCATION_ENABLED',
False)
SAHARA_VERIFICATION_DISABLED = getattr(
settings,

View File

@ -157,7 +157,7 @@ class GeneralConfigAction(workflows.Action):
plugin, hadoop_version = (
workflow_helpers.get_plugin_and_hadoop_version(request))
if not saharaclient.SAHARA_AUTO_IP_ALLOCATION_ENABLED:
if not saharaclient.SAHARA_FLOATING_IP_DISABLED:
pools = neutron.floating_ip_pools_list(request)
pool_choices = [(pool.id, pool.name) for pool in pools]
pool_choices.insert(0, (None, "Do not assign floating IPs"))