Skip to content

Commit 09b53f2

Browse files
authored
Merge pull request #36 from amazonlinux/pr/33
Print ec2-metadata error to stderr and add missing changelog entry
2 parents 37726e7 + e798318 commit 09b53f2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

amazon-ec2-utils.spec

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Source26: 53-ec2-read-ahead-kb.rules
1818
URL: https://github.com/aws/amazon-ec2-utils
1919
BuildArch: noarch
2020
Provides: ec2-utils = %{version}-%{release}
21-
Obsoletes: ec2-utils < 2.1
21+
Obsoletes: ec2-utils < 2.2
2222
Provides: ec2-metadata = %{version}-%{release}
23-
Obsoletes: ec2-metadata <= 0.1
23+
Obsoletes: ec2-metadata <= 0.1.3
2424
Requires: curl
2525
Requires: python3
2626
BuildRequires: python3-devel
@@ -76,9 +76,14 @@ rm -rf $RPM_BUILD_ROOT
7676

7777
%changelog
7878
* Thu Jan 18 2024 Keith Gable <[email protected]> - 2.2.0-1
79+
- Corrected issue where an ec2-metadata error was written to stdout
7980
- Change ec2nvme-nsid to use Bash string manipulation to improve
8081
performance and reliability
8182

83+
* Mon Jun 5 2023 Guillaume Delacour <[email protected]> - 2.2.0-1
84+
- Add `--quiet` option to `ec2-metadata --help` output
85+
- Add `-R`/`--region` option to `ec2-metadata` to discover the EC2 instance's region
86+
8287
* Thu Apr 6 2023 Noah Meyerhans <[email protected]> - 2.1.0-1
8388
- Add --quiet option to ec2-metadata
8489
- Add --partition support to ec2-metadata

ec2-metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
function print_help()
1010
{
11-
echo "ec2-metadata v0.1.3
11+
echo "ec2-metadata v0.1.4
1212
Use to retrieve EC2 instance metadata from within a running EC2 instance.
1313
e.g. to retrieve instance id: ec2-metadata -i
1414
to retrieve ami id: ec2-metadata -a
@@ -53,7 +53,7 @@ function set_imds_token()
5353
if [ -z "${IMDS_TOKEN}" ];then
5454
IMDS_TOKEN=$(curl -s -f -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 900" ${METADATA_BASEURL}/${METADATA_TOKEN_PATH})
5555
if [ "${?}" -gt 0 ] || [ -z "${IMDS_TOKEN}" ]; then
56-
echo '[ERROR] Could not get IMDSv2 token. Instance Metadata might have been disabled or this is not an EC2 instance.'
56+
echo '[ERROR] Could not get IMDSv2 token. Instance Metadata might have been disabled or this is not an EC2 instance.' >&2
5757
exit 1
5858
fi
5959
fi

0 commit comments

Comments
 (0)