Skip to content

Commit d1060c0

Browse files
author
Julian Sy
committed
Add __str__ method to BaseCommandResult
Method was added so that logging could be more understandable Change-Id: I3ca0382f05e88700c56d3c7f4b4ecf7b8fc3bc0c Closes-Bug: #1506409
1 parent d25d94b commit d1060c0

File tree

1 file changed

+7
-0
lines changed
  • ironic_python_agent/extensions

1 file changed

+7
-0
lines changed

ironic_python_agent/extensions/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ def __init__(self, command_name, command_params):
5555
self.command_error = None
5656
self.command_result = None
5757

58+
def __str__(self):
59+
return ("Command ID: %(id)s, Name: %(name)s "
60+
"Params: %(params)s Status: %(status)s (%(result)s)" %
61+
{"id": self.id, "name": self.command_name,
62+
"params": self.command_params, "status": self.command_status,
63+
"result": self.command_result})
64+
5865
def is_done(self):
5966
"""Checks to see if command is still RUNNING.
6067

0 commit comments

Comments
 (0)