Validating that python3 exists is not enough criteria to execute loguserdata with python3

Bug #1617069 reported by Vitalii Gridnev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Vitalii Gridnev
Mitaka
Fix Released
Undecided
Vitalii Gridnev

Bug Description

On ubuntu-trusty image I faced with issue at [0] when:
 1. python3 exists;
 2. pkg_resources can't be imported in python3.

That leads to issues with completing wait conditions with following errors in cloud-init logs:

 Traceback (most recent call last):
  File "/var/lib/cloud/instance/scripts/loguserdata.py", line 32, in <module>
    import pkg_resources
 ImportError: No module named 'pkg_resources'

So, I'm suggesting to use following approach to resolve this issue: when we have to determine what python executable should be used for executing loguserdata script, then should additionally check that all requirements are on the needed place.

[0] https://github.com/openstack/heat/blob/fcf725c7b31b109c014c4a4e06ea3e1d5abb2930/heat/cloudinit/loguserdata.py#L15

Moreover, please consider back-porting fix to stable/mitaka branch also.

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/360804

Changed in heat:
assignee: nobody → Vitaly Gridnev (vgridnev)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/361223

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/360804
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=f95a8051ca248044cb1655b19ef22b94a2c337ff
Submitter: Jenkins
Branch: master

commit f95a8051ca248044cb1655b19ef22b94a2c337ff
Author: Vitaly Gridnev <email address hidden>
Date: Fri Aug 26 01:05:51 2016 +0300

    Validate that python3 is ready for loguserdata

    By default, ubuntu trusty images has python3 executable in
    path, but we can't use that for executing loguserdata script,
    because pkg_resources can't be imported. Now it's proposed to
    try importing pkg_resources for validating readiness of
    python3 for executing this script. If pkg_resources can't be
    imported there is no other choice except using python2.

    Change-Id: Icb4f58630016874eb40dd77590469fc5de6287e4
    Closes-bug: 1617069

Changed in heat:
status: In Progress → Fix Released
Thomas Herve (therve)
Changed in heat:
milestone: none → newton-3
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/mitaka)

Reviewed: https://review.openstack.org/361223
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=ed46562157d2f9983f5665394ec47d2e27aad0df
Submitter: Jenkins
Branch: stable/mitaka

commit ed46562157d2f9983f5665394ec47d2e27aad0df
Author: Vitaly Gridnev <email address hidden>
Date: Fri Aug 26 01:05:51 2016 +0300

    Validate that python3 is ready for loguserdata

    By default, ubuntu trusty images has python3 executable in
    path, but we can't use that for executing loguserdata script,
    because pkg_resources can't be imported. Now it's proposed to
    try importing pkg_resources for validating readiness of
    python3 for executing this script. If pkg_resources can't be
    imported there is no other choice except using python2.

    Change-Id: Icb4f58630016874eb40dd77590469fc5de6287e4
    Closes-bug: 1617069

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 7.0.0.0b3

This issue was fixed in the openstack/heat 7.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 6.1.0

This issue was fixed in the openstack/heat 6.1.0 release.

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.