Island: Improve _aws_command_results_to_encodable_dict
By calling __dict__ we avoid the need to specify each dictionary key and make it the same as AWSCommandResults. This will allow for easier modification of AWSCommandResults.
This commit is contained in:
parent
c685ce3725
commit
499fec2574
|
@ -67,10 +67,6 @@ class RemoteRun(flask_restful.Resource):
|
|||
|
||||
@staticmethod
|
||||
def _aws_command_results_to_encodable_dict(aws_command_results: AWSCommandResults):
|
||||
return {
|
||||
"instance_id": aws_command_results.instance_id,
|
||||
"response_code": aws_command_results.response_code,
|
||||
"stdout": aws_command_results.stdout,
|
||||
"stderr": aws_command_results.stderr,
|
||||
"status": aws_command_results.status.name.lower(),
|
||||
}
|
||||
res_dict = aws_command_results.__dict__
|
||||
res_dict["status"] = res_dict["status"].name.lower()
|
||||
return res_dict
|
||||
|
|
Loading…
Reference in New Issue