mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
b7283bcc6f
commit
c7cffb5a04
1 changed files with 1 additions and 17 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue