Skip to content

Some housekeeping changes and new script to make regression testing easier#54

Merged
fred-lefebvre merged 2 commits intoamazonlinux:mainfrom
fred-lefebvre:main
Apr 2, 2026
Merged

Some housekeeping changes and new script to make regression testing easier#54
fred-lefebvre merged 2 commits intoamazonlinux:mainfrom
fred-lefebvre:main

Conversation

@fred-lefebvre
Copy link
Copy Markdown
Member

Housekeeping changes to ec2-metadata:

  • Fix inconsistent formatting in ec2-metadata
  • Consistently quote variables when used to generate command lines
  • Address inconsistent function naming

Add a new tests/capture-output.sh for regression testing

  • Makes it easier to capture the output of every subcommand of ec2-metadata

Testing

  • ran tests/capture-output.sh before changes
  • ran tests/capture-output.sh after changes
  • The diff of the 2 resulting directories shows no change.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.


#print standard metric
function print_normal_metric() {
metric_path=$2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

metric_path="$2" ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no word splitting or glob expansion on the right-hand side of variable assignments. metric_path="$2" is always equivalent to metric_path=$2 in this case.


#print block-device-mapping
function print_block-device-mapping()
function print_block_device_mapping()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! amazon-ec2-utils.spec and its %changelog were not updated in this PR. Will there be a follow-up PR ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. I'll update the spec file and version with upcoming functional changes

@fred-lefebvre fred-lefebvre merged commit d84cf6d into amazonlinux:main Apr 2, 2026
1 check 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