loguserdata.py does not work with cloud-init >= 0.7.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
High
|
Clint Byrum |
Bug Description
In versions of cloud-init prior to 0.6.x, cfn-userdata would be executed by cloud-init
In 0.6.x, loguserdata.py has to chmod +x cfn-userdata and run it, and log the output.
In doing so, it tries to find out the data path from cloudinit and assumes if cloudinit.
In fact with 0.7.x the call has been removed and the code to get the same data is quite a bit more complex.
So, it seems that things have been intertwined that should not.
* We need to detect if an old version of cloud-init already ran cfn-userdata
* We need to write files to disk in a predictable location.
The solution is to detect the version of cloudinit. 0.6.x did not have cloudinit.version, so this code should do the trick:
from distutils import version as vr
import cloudinit
if hasattr(cloudinit, 'get_cpath'):
ci_version = vr.StrictVersio
else:
try:
import cloudinit.version
except ImportError:
ci_version = vr.StrictVersio
else:
ci_version = cloudinit.
if ci_version < vr.StrictVersio
log_message()
sys.exit(0)
Changed in heat: | |
importance: | Undecided → High |
Changed in heat: | |
milestone: | none → grizzly-3 |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | grizzly-3 → 2013.1 |
Oh also we should just assume /var/lib/cloud/data ... everything else in heat does. Actually longer term, we should move all of that to /var/lib/heat/data