[BUG] slack returner fail when `changes: True`
Open
Nobody has claimed this yet.
bug
severity-high
slack
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
slack returner don't work with
slack.changes or slack.only_show_failed
Setup
salt 3001.1 on master/minion on ubuntu16.04
Expected behavior
receive report on changes or failed states
Additional context
2020-09-04 08:52:09,266 [salt.minion :1820][ERROR ][2638] The return failed for job 20200904085127809008: unhashable type: 'dict'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/minion.py", line 1811, in _thread_return
minion_instance.returners[returner_str](ret)
File "/usr/lib/python3/dist-packages/salt/returners/slack_returner.py", line 218, in returner
returns = {(key, value) for key, value in returns.items() if value['result'] is not True or value['changes']}
File "/usr/lib/python3/dist-packages/salt/returners/slack_returner.py", line 218, in <setcomp>
returns = {(key, value) for key, value in returns.items() if value['result'] is not True or value['changes']}
TypeError: unhashable type: 'dict'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in salt/returners/slack_returner.py at line 218, where filtering reports with changes or only_show_failed produces the unhashable dict error. Reproduce the returner behavior using the Salt 3001.1 setup and the reported options. Done means the Slack returner sends reports for changed or failed states without this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100