salt-netapi-client icon indicating copy to clipboard operation
salt-netapi-client copied to clipboard

Investigate better error detection

Open lucidd opened this issue 6 years ago • 1 comments

Salt seems to have added an option called full_return which should give more metadata about the result such as success or failure indication. https://docs.saltstack.com/en/latest/ref/clients/#salt.client.LocalClient.cmd with that we should hopefully be able to detect errors more reliably. with full_return

{"return": [{"minion1": {"jid": "20190318124528105688", "retcode": 0, "ret": true}}]}

without full_return

{"return": [{"minion1": true}]}

We should set full_return allways to true since we need the information for error detection. full_return in the request to the api is on the same level as the client value for example.

We also need to adjust the gson type adapter responsible for parsing results and take the new error information into account.

One thing unknown is how this effects wheel and runner calls.

lucidd avatar May 18 '18 12:05 lucidd

My "solution" was to add retcode to the Return class and make it accessible in Jobs.Info. Not sure if this fully makes sense but it was enough for my purposes.

rmartens-embotics avatar Dec 04 '18 15:12 rmartens-embotics