Fix issue with using roster_defaults with flat or cloud rosters.

fixes #43449
fixes #43643
This commit is contained in:
Corvin Mcpherson 2017-10-03 12:56:44 -04:00
parent 36b0b1174b
commit aebe76b6f8
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613
))
preferred_ip = extract_ipv4(roster_order, ip_list)
ret[minion_id] = __opts__.get('roster_defaults', {})
ret[minion_id] = __opts__.get('roster_defaults', {}).copy()
ret[minion_id].update({'host': preferred_ip})
ssh_username = salt.utils.cloud.ssh_usernames(vm_, cloud_opts)

View File

@ -142,7 +142,7 @@ class RosterMatcher(object):
'''
Return the configured ip
'''
ret = __opts__.get('roster_defaults', {})
ret = __opts__.get('roster_defaults', {}).copy()
if isinstance(self.raw[minion], string_types):
ret.update({'host': self.raw[minion]})
return ret