This block isn't necessary

If a location isn't passed to list_nodes_full, we can just use get_location().
Of no location is set in the provider, it will just use get_location().

The problem with the lookup if there are profiles, is the way that the
provider/driver was changed in the last release, if it just uses the profile
directly, it will fail when trying to do a full list.

Then for multiple locations being called, each provider has to have a location
in it, and will be called once, as it stands now, if you have multiple
providers, minions from each provider could be doubled up with this lookup.

This change should meet all the needs that this if statement was added for, and not fail in 2017.7
This commit is contained in:
Daniel Wallace 2017-08-21 11:45:11 -06:00
parent b7283bcc6f
commit c7cffb5a04

View file

@ -3428,23 +3428,7 @@ def list_nodes_full(location=None, call=None):
'or --function.'
)
if not location:
ret = {}
locations = set(
get_location(vm_) for vm_ in six.itervalues(__opts__['profiles'])
if vm_.get('driver') == 'ec2'
)
# If there aren't any profiles defined for EC2, check
# the provider config file, or use the default location.
if not locations:
locations = [get_location()]
for loc in locations:
ret.update(_list_nodes_full(loc))
return ret
return _list_nodes_full(location)
return _list_nodes_full(location or get_location())
def _extract_name_tag(item):