diff --git a/debian/changelog b/debian/changelog index 1469b07f..48191b11 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 ] diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 45773f5d..f6ea7321 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -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" diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index 365b3d97..b60c59b4 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -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