ec2-bundle-image gives error 'can't convert Fixnum into String' with ruby 1.9
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ec2-ami-tools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
$ ec2-bundle-image --cert cert.pem --privatekey pk.pem --user 123456789012 --image my.img --arch i386 --debug
Bundling image file...
ERROR: can't convert Fixnum into String
#<TypeError: can't convert Fixnum into String>
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
I found this when trying with real cert.pem and pk.pem and user, but the error occurs before those things are actually tested, so you can do:
mkdir foo; cd foo
img=my.img; cert=cert.pem; pk=pk.pem; user=123456789012
truncate --size 1M $img
mke2fs -F $img
touch $cert $pk
ec2-bundle-image --cert $cert --privatekey $pk --user $user --image $img --arch i386 --debug
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: ec2-ami-tools 1.4.0.2-0ubuntu1
ProcVersionSign
Uname: Linux 3.5.0-19-generic x86_64
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
Date: Mon Dec 10 11:07:25 2012
EcryptfsInUse: Yes
InstallationDate: Installed on 2011-10-19 (418 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
PackageArchitec
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ec2-ami-tools
UpgradeStatus: Upgraded to quantal on 2011-11-07 (399 days ago)
summary: |
- ec2-bundle-image gives error 'can't convert Fixnum into String' + ec2-bundle-image gives error 'can't convert Fixnum into String' with + ruby 1.9 |
This seems to be a change from ruby 1.8 to 1.9, that caused 'gen_ident' to be valid. .inject( "") {|ident, n| ident+(?A + Kernel. rand(26) ).chr}
basically, before it had:
##
# generate a unique identifier used for filenames
#
def gen_ident()
(0..19)
end
That needs updating to: 19).inject( "") {|ident, n| ident+(?A.ord + Kernel. rand(26) ).chr}
(0..