Skip to content

Commit

Permalink
revert parameter set print code
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Chen <[email protected]>
  • Loading branch information
ihasdapie committed Aug 26, 2022
1 parent 7f22eb3 commit b037bc5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ros2param/ros2param/verb/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ def main(self, *, args): # noqa: D102
results = response.results

for i, result in enumerate(results):
print('Set parameter ' + parameters[i].name + ' ' +
'successful' if result.successful else 'failed' +
str(result.reason) if result.reason else '',
file=sys.stderr if result.successful else sys.stdout)
if result.successful:
msg = f'Set parameter {parameters[i].name} successful'
if result.reason:
msg += ': ' + result.reason
print(msg)
else:
msg = 'Set parameter failed'
if result.reason:
msg += ': ' + result.reason
print(msg, file=sys.stderr)

0 comments on commit b037bc5

Please sign in to comment.