usr/share/byobu/ec2/rates.us-east-1, usr/bin/byobu-janitor:

This commit is contained in:
Dustin Kirkland 2011-05-25 18:55:23 -05:00
commit 198f9c5ee3
3 changed files with 7 additions and 4 deletions

2
debian/changelog vendored
View file

@ -30,7 +30,7 @@ byobu (4.3) unreleased; urgency=low
usr/share/byobu/ec2/rates.eu_ie => usr/share/byobu/ec2/rates.eu-
west-1, usr/share/byobu/ec2/rates.us_ca => usr/share/byobu/ec2/us-
west-1, usr/share/byobu/ec2/rates.us_va =>
usr/share/byobu/ec2/rates.us-east-1:
usr/share/byobu/ec2/rates.us-east-1, usr/bin/byobu-janitor:
- rework ec2_cost entirely, using metaservice; much more accurate
[ Scott Moser ]

View file

@ -171,5 +171,8 @@ if [ -h "$RUN/$PKG.ssh-agent" ]; then
mv -f "$RUN/$PKG.ssh-agent" "$DATA/.ssh-agent"
fi
# Affects: Upgrades from <= byobu 4.3, remove ec2_rates
rm -f "$DATA/ec2_rates"
# Clean up flag
rm -f "$FLAG"

View file

@ -33,9 +33,9 @@ done
# Try to use metadata service
zone=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone || echo "us-east-1")
. "$BYOBU_PREFIX/share/$PKG/ec2/rates.$zone"
if type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type); then
RATE=$(eval ${type/./_})
. "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}"
if type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | sed -e "s/\./_/g"); then
eval RATE="\$$type"
else
# Count CPUs, Memory, Architecture
cpu=$(grep -c "^processor.*:" /proc/cpuinfo) || cpu=1