Bugfix: manage.down crash#48447
Conversation
rallytime
left a comment
There was a problem hiding this comment.
This looks good except for one PY2/3 compatibility comment.
There was a problem hiding this comment.
str() should be six.text_type here for PY3
|
@rallytime here. You have it! 😉 |
|
re-run all |
There was a problem hiding this comment.
We're missing a {0} here, I think? We've got two in .format, but only one {} string.
There was a problem hiding this comment.
@KaiSforza yes, sir! We did. Thanks for spotting this. Fixd.
There was a problem hiding this comment.
Thank the linter for spotting it! Hopefully it'll be better next time!
|
@rallytime should be OK now. |
|
Honestly, I really don't like this much change in the runner, where we've had regression problems in the past, just to cover this single edge case. Can't we just clean up the way the error is displayed in the LocalClient? |
But there are no changes actually. All I did is this:
So I don't expect any regressions. Instead I am trying to bring scattered bits into their "homes". It is not finished though, because other PRs are still pending and blocking it. |
|
@isbm Thanks. Makes sense. What PRs are blocking this? |
|
@cachedout sorry for the mis-wording this: not an actual PRs, but the further moves. I was actually fixing the runner issue, but text formatter function supposed to be intermediary that I will refactor it seamlessly in my further PRs that are related here. Sometimes it just cannot go in parallel... |
There was a problem hiding this comment.
Do we really need to log the exception here given that we're returning an error to the user? We've never really standardized on one behavior over the other.
067ae52 to
c524316
Compare
@cachedout I personally think we have to return errors to the logs in any case. Because when you want to troubleshoot a production system, you usually take logs. And have all that recorded gives you a better view what user is trying to do. Besides, the exception originally only assumes that the error is wrong parameters. In fact, it can also be that the function is broken and something else might happen. But I've changed this as you wish. |
|
@cachedout BTW, speaking of standard here would be a very good time, since I would have a take on logging messages to clean them up: lots of misleading and cryptic messages are going to all logging levels we use. So if you would add here your thoughts, that would be a very good timing. |
|
@cachedout just now I found it. An example why I think errors should not be assumed, but logged in details, separately, even if this is CLI. On Python 3, The "Passed invalid arguments: unorderable types: Process() < Process()" doesn't look right, because ( P.S. I am fixing this too, BTW. |
|
@isbm This has one lint failure. It is also causing a bunch of related tests to fail. Can you take a look? |
a41a7c0 to
7e66b81
Compare
|
Apologies, @isbm but we have a merge conflict on this now. |
f032b65 to
a1e7885
Compare
|
@cachedout done! |
|
@isbm Thanks! There are a couple of DRY suggestions that CodeClimate has here. Do you want to take a look at those? It's not required of course but they're just suggestions. |
|
@cachedout but this is not really my code. I would go further refactoring of course, and slicing more, but then you will again say I am touching holy runner. 😉 Maybe let it pass finally as it is for now, and then in next PRs I will get back to this (since we have work around runners too, so could be an opportunity to watering climate down indeed). |
|
@isbm Looks like some tests are unhappy with this change. |
|
@isbm Bump. :) |
|
@cachedout yep, moment. |
|
@isbm Thanks. Just ping me when we're ready here. :) |
|
Hi @isbm - is this something you're still working on? |
Return a return code on generic failure
f54ff37 to
bf7cc1e
Compare
|
@rallytime there was tests issue, I rebased to refresh and see what's still broken. |
|
@rallytime this is kind of stuck. What do we do and what are all those errors? 😉 |
|
@isbm, what is the status here? |
|
@dwoz this needs to be reverted. It's breaking the runner. Every ret is coming back with 70 which according to https://github.com/saltstack/salt/blob/develop/salt/defaults/exitcodes.py#L36 is an internal server error. I found this by using |
|
@austinpapp or change error code here. I am no longer sure why it end up with the |
|
@isbm happy to make a change. However, im not sure what the intention of the |
|
@austinpapp I am not really sure, seems in this commit: fa12414 I am actually doing this. But as much as I remember, I only spitted already existing work. Either code was already there like this, or got changed Nevertheless, seems if the whole this block would go away, that should do it. Because it works only if Exception doesn't happen and this return thus won't be overridden. Again, apologies for the inconvenience. |
What does this PR do?
Bugfix.
Previous Behavior
salt-run manage.<anything>New Behavior
Result:
Tests written?
No