Skip to content

[BUG] salt-ssh does not merge master top returns per saltenv #65480

Closed
@lkubb

Description

Description
When multiple master top modules are defined and return targeted states for the same environment, salt-ssh does not merge the returns, but only keeps the last one. This is a discrepancy vs. regular Salt.

Setup
Enable two master top modules which return states for the same saltenv, e.g. base in the master config.

Steps to Reproduce the behavior
Check the output of salt-ssh foobar state.show_top.

Expected behavior
Lists should be merged, as usual.

Screenshots

for fun in self.tops:
if fun not in self.opts.get("master_tops", {}):
continue
try:
ret.update(self.tops[fun](opts=self.opts, grains=grains))

for fun in self.tops:
if fun not in self.opts.get("master_tops", {}):
continue
try:
ret = salt.utils.dictupdate.merge(
ret, self.tops[fun](opts=opts, grains=grains), merge_lists=True
)

Versions Report
current master

Additional context
I just stumbled over this while writing a PR for #65479. Thought it was noteworthy enough.

Tangentially related: #59802

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions