Fix error during node group template update

this is because an optional key is referenced in calling validation
function which results in KeyError when key doesn't exist, and it
does not ever actually get used.

Change-Id: I12be69b5caf81289c2b8070fab8d2083709d6cf7
Closes-Bug: #1672516
(cherry picked from commit a76a9011df)
This commit is contained in:
zhuli 2017-07-29 11:42:13 -04:00 committed by Jeremy Freudberg
parent 41ee977970
commit 0dc238ea60
1 changed files with 2 additions and 2 deletions

View File

@ -160,7 +160,7 @@ def check_node_group_basic_fields(plugin_name, hadoop_version, ng,
_("You must specify a volumes_size parameter"))
if ng.get('floating_ip_pool'):
check_floatingip_pool_exists(ng['name'], ng['floating_ip_pool'])
check_floatingip_pool_exists(ng['floating_ip_pool'])
if ng.get('security_groups'):
check_security_groups_exist(ng['security_groups'])
@ -189,7 +189,7 @@ def check_security_groups_exist(security_groups):
sg, _("Security group '%s' not found"))
def check_floatingip_pool_exists(ng_name, pool_id):
def check_floatingip_pool_exists(pool_id):
network = None
if CONF.use_neutron:
network = nova.get_network(id=pool_id)