Properly aggregate version when passed with name

This fixes an issue in which states which contained a single package
name (no "pkgs" or "sources") paired with a "version" argument, were
having the version ignored. This is because just the name was being
added to the aggregated "pkgs".

Since we're munging low data to aggregate states, this bug wouldn't even
result in the state failing if a different version were installed.
This commit is contained in:
Erik Johnson 2017-03-23 11:36:22 -05:00
parent 62d76f50fc
commit 0055fda3e9

View File

@ -2431,9 +2431,11 @@ def mod_aggregate(low, chunks, running):
pkgs.extend(chunk['pkgs'])
chunk['__agg__'] = True
elif 'name' in chunk:
pkgs.append(chunk['name'])
if 'version' in chunk:
pkgs.append({chunk['name']: chunk['version']})
else:
pkgs.append(chunk['name'])
chunk['__agg__'] = True
if pkg_type is not None and pkgs:
if pkg_type in low:
low[pkg_type].extend(pkgs)