-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #59033: salt-ssh error when targetting IPs or hostnames directly #60729
Fix #59033: salt-ssh error when targetting IPs or hostnames directly #60729
Conversation
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
90ef3b1
to
c80f6cb
Compare
1880a39
to
15c170a
Compare
@javicacheiro can you remove this PR from draft status |
Done! |
try: | ||
roster_host = roster_data[host_id].get("host") | ||
except AttributeError: | ||
roster_host = roster_data[host_id] | ||
if hostname in [host_id, roster_host]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion(non-blocking) this could be written as if hostname in [host_id, roster_data.get(host_id, {}).get("host")]:
Not sure if that's easier to read or not 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, this does fail with the existing test suite, so maybe not :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked this code out, and ran the tests. I even swapped the code back to what I suggested and saw the same error, so...
👍 this is actually good as-is.
Congratulations on your first PR being merged! 🎉 |
What does this PR do?
Fixes salt-ssh error when targetting IPs or hostnames directly
What issues does this PR fix or reference?
Fixes: #59033
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No