Skip to content

Commit

Permalink
[CodeStyle] Address Shellcheck finding 'SC2155 in iso-ca-bundle-confi…
Browse files Browse the repository at this point in the history
…g.sh': _token variable is now declared and assigned separately to avoid masking return values.

Signed-off-by: Giacomo Marciani <[email protected]>
  • Loading branch information
gmarciani committed Oct 15, 2024
1 parent 9282157 commit e87af87
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -ex

function get_instance_region {
local _token=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 3600")
local _token
_token=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 3600")
curl -H "X-aws-ec2-metadata-token: $_token" -v "http://169.254.169.254/latest/meta-data/placement/region" 2> /dev/null
}

Expand Down

0 comments on commit e87af87

Please sign in to comment.