AttributeError thrown for True values

Bug #507709 reported by Ronen Botzer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Fix Released
Wishlist
Unassigned
ec2-init (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

Binary package hint: ec2-init

In Ubuntu 9.10 (Karmic) => ec2-ami-tools package (multiverse) => /usr/bin/ec2-fetch-credentials
An AttributeError is raised by ec2init (uncaught) for a value equivalent to True ("on", "1", "yes"):

root@ip-10-243-109-226:/home/ubuntu# lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10
root@ip-10-243-109-226:/home/ubuntu# which ec2-fetch-credentials
/usr/bin/ec2-fetch-credentials
root@ip-10-243-109-226:/home/ubuntu# ec2-fetch-credentials
Traceback (most recent call last):
  File "/usr/bin/ec2-fetch-credentials", line 67, in <module>
    main()
  File "/usr/bin/ec2-fetch-credentials", line 49, in main
    disable_root = ec2.get_cfg_option_bool('disable_root', True)
  File "/usr/lib/python2.6/dist-packages/ec2init/__init__.py", line 58, in get_cfg_option_bool
    if val.lower() in ['1', 'on', 'yes']:
AttributeError: 'bool' object has no attribute 'lower'
root@ip-10-243-109-226:/home/ubuntu# cat /etc/ec2-init/ec2-config.cfg
user="ubuntu"
DISABLE_ROOT="on"

The issue is that configob.ConfigObj.get('disable_root', True) returns True for one of "1","on","yes" already, rather than a string.

I'm attaching a patch.

Related branches

Revision history for this message
Ronen Botzer (ronen) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

Wont' fix this in ec2-init. cloud-init replaced that in lucid.

Changed in ec2-init (Ubuntu):
importance: Undecided → Wishlist
status: New → Won't Fix
Revision history for this message
Scott Moser (smoser) wrote :

I do not believe that this bug is still relevant... in current versions of cloud-init in lucid, you should not see the thrown error, but the matching is not done case-insensitive. I just committed a patch to trunk (r185) that does case insensitive matching.

Changed in cloud-init (Ubuntu):
importance: Undecided → Wishlist
status: New → Fix Committed
Scott Moser (smoser)
Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.