Merge lp:~wingc/cloud-init/fix-chef-omnibus-install into lp:~cloud-init-dev/cloud-init/trunk
Status: | Merged |
---|---|
Merged at revision: | 819 |
Proposed branch: | lp:~wingc/cloud-init/fix-chef-omnibus-install |
Merge into: | lp:~cloud-init-dev/cloud-init/trunk |
Diff against target: |
12 lines (+1/-1) 1 file modified
cloudinit/config/cc_chef.py (+1/-1) |
To merge this branch: | bzr merge lp:~wingc/cloud-init/fix-chef-omnibus-install |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser | Pending | ||
Review via email:
|
Description of the change
cloud-init fails to install the Chef client via 'omnibus' installer, support for which was added in the following change:
http://
--- cloudinit/
...
elif install_type == 'omnibus':
url = util.get_
content = url_helper.
with util.tempdir() as tmpd:
# use tmpd over tmpfile to avoid 'Text file busy' on execute
...
Here 'content' is a UrlRequest object, but util.write_file() dies with an exception due to a debug statement:
--- cloudinit/util.py ---
...
def write_file(
"""
Writes a file with the given content and sets the file mode as specified.
Resotres the SELinux context if possible.
@param filename: The full path of the file to write.
@param content: The content to write to the file.
@param mode: The filesystem mode to set on the file.
@param omode: The open mode used when opening the file (r, rb, a, etc.)
"""
ensure_
LOG.
...
The UrlResponse class does not expose a method for len():
#
# example failure log from a CentOS 6.x host, with cloud-init 0.7.2 installed from RPM
#
2013-05-20 21:35:21,247 - util.py[WARNING]: Running chef (<module 'cloudinit.
2013-05-20 21:35:21,247 - util.py[DEBUG]: Running chef (<module 'cloudinit.
Traceback (most recent call last):
File "/usr/lib/
cc.
File "/usr/lib/
return self._runners.
File "/usr/lib/
results = functor(*args)
File "/usr/lib/
util.
File "/usr/lib64/
self.
File "/usr/lib/
yield tdir
File "/usr/lib/
util.
File "/usr/lib/
filename, omode, mode, len(content))
TypeError: object of type 'UrlResponse' has no len()
My proposed fix is to convert the UrlReponse into a plain string and pass that to util.write_file(), which makes things work as expected.
Christopher,
Thanks for catching the bug, debugging and submitting a fix.
I've opened bug 1182265. Bugs are required to get anything SRU'd into Ubuntu and this would be good to SRU into 13.04.