Error in exec/local.py run method when OSError is thrown #172

Closed
opened 2021-11-20 15:20:43 +00:00 by ungleich-gitea · 2 comments

Created by: darko-poljak

line 197 catches OSError and line 198 tries to raise cdist.Error:
raise cdist.Error(" ".join(*args) + ": " + error.args[1])
args is not defined in this scope.
Even if this is changed to error.args error is for join: it expects one argument (sequence),
but *args unpacks list/tuple.

So this should be
raise cdist.Error(" ".join((str(x) for x in error.args)) + ": " + error.args[1])
(error.args tuple contains int too).

Or the intention was actually this?
raise cdist.Error(str(error.args[0]) + ": " + error.args[1])

*Created by: darko-poljak* line 197 catches OSError and line 198 tries to raise cdist.Error: ` raise cdist.Error(" ".join(*args) + ": " + error.args[1]) ` args is not defined in this scope. Even if this is changed to error.args error is for join: it expects one argument (sequence), but *args unpacks list/tuple. So this should be ` raise cdist.Error(" ".join((str(x) for x in error.args)) + ": " + error.args[1]) ` (error.args tuple contains int too). Or the intention was actually this? ` raise cdist.Error(str(error.args[0]) + ": " + error.args[1]) `
Author
Owner

Created by: darko-poljak

Code is merged with ungleich/master.

*Created by: darko-poljak* Code is merged with ungleich/master.
Author
Owner

Created by: telmich

The idea was to pass on the error to the user - does that help?

*Created by: telmich* The idea was to pass on the error to the user - does that help?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ungleich-public/cdist#172
No description provided.