Skip to content

api_server: convert the VmmActionError to a JSON object #1547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 28, 2020

Conversation

kzys
Copy link
Contributor

@kzys kzys commented Jan 24, 2020

The response from this function has content-type:application/json and
Swagger specifies that the JSON object must have "fault_message".

However the implementation was returning a plan string such as
"vCPUs resume failed." which broke clients.

Signed-off-by: Kazuyoshi Kato [email protected]

Reason for This PR

The response from this function has content-type:application/json and
Swagger specifies that the JSON object must have "fault_message".

However the implementation was returning a plan string such as
"vCPUs resume failed." which broke clients.

Description of Changes

It adds ApiServer::json_fault_message() to convert a string to a valid JSON document.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

PR Checklist

[Author TODO: Meet these criteria. Where there are two options, keep one.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • Either this PR is linked to an issue, or, the reason for this PR is
    clearly provided.
  • The description of changes is clear and encompassing.
  • Either no docs need to be updated as part of this PR, or, the required
    doc changes are included in this PR. Docs in scope are all *.md files
    located either in the repository root, or in the docs/ directory.
  • Either no code has been touched, or, code-level documentation for touched
    code is included in this PR.
  • Either no API changes are included in this PR, or, the API changes are
    reflected in firecracker/swagger.yaml.
  • Either the changes in this PR have no user impact, or, the changes in
    this PR have user impact and have been added to the CHANGELOG.md file.
  • Either no new unsafe code has been added, or, the newly added unsafe
    code is unavoidable and properly documented.

kzys added 2 commits January 24, 2020 13:09
The response from this function has content-type:application/json and
Swagger specifies that the JSON object must have "fault_message".

However the implementation was returning a plan string such as
"vCPUs resume failed." which broke clients.

Signed-off-by: Kazuyoshi Kato <[email protected]>
When "PUT /logger" returns an error, the error message must be wrapped as
a JSON object.

Signed-off-by: Kazuyoshi Kato <[email protected]>
@andreeaflorescu andreeaflorescu added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Jan 27, 2020
@dianpopa dianpopa merged commit 9e68aa4 into firecracker-microvm:master Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants