[SRU] datasource for smartos uses util.is_true instead of futil.is_true

Bug #1247262 reported by Ben Howard on 2013-11-01
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
High
Ben Howard
Precise
High
Ben Howard

Bug Description

[Impact]: The cloud-init version Precise uses the wrong is_true test from util instead of futil for the SmartOS datasource. If a user sends over a user-script or user-data, the instance will be unaccessable due to a stack trace. This means that user-data or user-scripts are fatal to the instance as the user will be unable to access system using SmartOS as the virtualization platform.

This only affects 12.04. futil is a backport of utilities in future version. util.is_true is valid for 12.10 and later. As result, there is no fix needed for quantal and later.

[Test Case]:
1. Create a simple user-data script
2. Boot up 12.04 in SmartOS
3. Update the instance meta-data with user-script
4. delete /var/lib/cloud
5. Run "cloud-init start" and "cloud-init-cfg all"
6. Check /var/log/cloud-init.log for errors
7. Confirm that simple user-data script ran
8. The user-data script should be found in /var/lib/cloud/instance/user-data.txt

[REGRESSION] None. This change is fixes broken functionality and is a two line change. This has been tested on SmartOS and confirmed to fix the problem.

datasource for smartos uses util.is_true instead of futil.is_true, this causes a stack trace on SmartOS

2013-11-01 18:21:39,683 - cloud-init[INFO]: cloud-init start-local running: Fri, 01 Nov 2013 18:21:39 +0000. up 7.28 seconds
2013-11-01 18:21:39,874 - __init__.py[DEBUG]: searching for data source in []
2013-11-01 18:21:39,874 - __init__.py[DEBUG]: Did not find data source. searched classes: []
2013-11-01 18:21:43,765 - cloud-init[INFO]: cloud-init start running: Fri, 01 Nov 2013 18:21:43 +0000. up 11.19 seconds
2013-11-01 18:21:43,861 - __init__.py[DEBUG]: searching for data source in ['DataSourceSmartOS']
2013-11-01 18:21:43,861 - DataSourceSmartOS.py[DEBUG]: Getting hostname from dmidecode
2013-11-01 18:21:43,864 - DataSourceSmartOS.py[DEBUG]: Determining hypervisor product name via dmidecode
2013-11-01 18:21:45,485 - __init__.py[WARNING]: get_data of DataSourceSmartOS raised 'module' object has no attribute 'is_true'
2013-11-01 18:21:45,500 - util.py[DEBUG]: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 215, in get_data_source
    if s.get_data():
  File "/usr/lib/python2.7/dist-packages/cloudinit/DataSourceSmartOS.py", line 144, in get_data
    md[ci_noun] = self.query(smartos_noun, strip=strip)
  File "/usr/lib/python2.7/dist-packages/cloudinit/DataSourceSmartOS.py", line 178, in query
    b64=b64)
  File "/usr/lib/python2.7/dist-packages/cloudinit/DataSourceSmartOS.py", line 240, in query_data
    b64 = util.is_true(b64)
AttributeError: 'module' object has no attribute 'is_true'

2013-11-01 18:21:45,500 - __init__.py[DEBUG]: Did not find data source. searched classes: ['DataSourceSmartOS'] {noformat}
{noformat}

Ben Howard (darkmuggle) on 2013-11-01
summary: - datasource for smartos uses util.is_true instead of futil.is_true
+ [SRU] datasource for smartos uses util.is_true instead of futil.is_true
Ben Howard (darkmuggle) on 2013-11-01
description: updated
description: updated
Ben Howard (darkmuggle) on 2013-11-01
affects: ubuntu → cloud-init (Ubuntu)
Ben Howard (darkmuggle) on 2013-11-01
description: updated

Hello Ben, or anyone else affected,

Accepted cloud-init into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cloud-init/0.6.3-0ubuntu1.9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cloud-init (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Changed in cloud-init (Ubuntu Precise):
importance: Undecided → High
Ben Howard (darkmuggle) wrote :

Verification done on SmartOS instance. Marking verification done.

Changed in cloud-init (Ubuntu Precise):
assignee: nobody → Ben Howard (utlemming)
Changed in cloud-init (Ubuntu):
status: In Progress → Fix Released
tags: added: cloud-images cloud-init verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.6.3-0ubuntu1.9

---------------
cloud-init (0.6.3-0ubuntu1.9) precise-proposed; urgency=low

  * debian/patches/lp-1247262-fix_futils_smartos.patch:
    fixed usage of util.is_true to be futil.is_true for SmartOS
    datasource. (LP: #1247262)
 -- Ben Howard <email address hidden> Fri, 01 Nov 2013 13:51:31 -0600

Changed in cloud-init (Ubuntu Precise):
status: Fix Committed → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers