Fixed possible incorrect behavior if target wasn't on start/end of str

This commit is contained in:
Robin Björklin 2016-12-02 10:47:26 +01:00
parent 7440582ce8
commit 171cab1726

View file

@ -164,7 +164,7 @@ def ext_pillar(minion_id,
match = target_re.search(temp)
if match:
opts['target'] = match.group(1)
temp = temp.strip(match.group(0))
temp = temp.replace(match.group(0), '')
checker = salt.utils.minions.CkMinions(__opts__)
minions = checker.check_minions(opts['target'], 'compound')
if minion_id not in minions:
@ -174,7 +174,7 @@ def ext_pillar(minion_id,
match = root_re.search(temp)
if match:
opts['root'] = match.group(1)
temp = temp.strip(match.group(0))
temp = temp.replace(match.group(0), '')
else:
opts['root'] = ""
@ -182,7 +182,7 @@ def ext_pillar(minion_id,
match = profile_re.search(temp)
if match:
opts['profile'] = match.group(1)
temp = temp.strip(match.group(0))
temp = temp.replace(match.group(0), '')
else:
opts['profile'] = None