Skip to content
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

cmd: Don't write json status files for non-boot stages #4478

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

holmanb
Copy link
Member

@holmanb holmanb commented Oct 2, 2023

      cmd: Don't write json status files for non-boot stages
      
      Don't use status_wrapper() for `cloud-init modules --mode init`.
      
      Both status.json and result.json are currently written when `cloud-init
      modules --mode init` is ran. This is unecessary since this is not a boot
      command used by cloud-init, and as a workaround for previous bugs related to
      this behavior this leaves behind unwanted keys in status.json.
      
      This aligns cloud-init code's behavior with documented behavior.

@holmanb holmanb changed the title Holmanb/machine readable output cmd: Don't write json status files for non-boot stages Oct 2, 2023
@holmanb holmanb force-pushed the holmanb/machine-readable-output branch from 229f6ce to c91fed6 Compare October 2, 2023 04:53
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. Can we get a unit test ensuring the correct files are written?

@TheRealFalcon TheRealFalcon self-assigned this Oct 3, 2023
Don't use status_wrapper() for `cloud-init modules --mode init`.

Both status.json and result.json are currently written when `cloud-init
modules --mode init` is ran. This is unecessary since this is not a boot
command used by cloud-init, and as a workaround for previous bugs related to
this behavior this leaves behind unwanted keys in status.json.

This aligns cloud-init code's behavior with documented behavior.
@holmanb holmanb force-pushed the holmanb/machine-readable-output branch from 634ee12 to 119f26d Compare October 7, 2023 18:49
@holmanb
Copy link
Member Author

holmanb commented Oct 7, 2023

Code LGTM. Can we get a unit test ensuring the correct files are written?

Thanks for the review @TheRealFalcon. Done.

Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'll leave to you to merge

@holmanb holmanb merged commit f780cf9 into canonical:main Oct 9, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants