Comparison of String < Integer errors for operating system release

Bug #1425300 reported by Mike Dorman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-cinder
Fix Released
Undecided
Gael Chamoulaud
puppet-manila
Fix Released
Undecided
Gael Chamoulaud
puppet-nova
Fix Released
Undecided
Gael Chamoulaud
puppet-openstacklib
Fix Released
Undecided
Gael Chamoulaud

Bug Description

Under Puppet 4.x language (i.e. future parser and evaluator), if the ::operatingsystemmajrelease fact (or related ones) evaluates to a string, then numeric comparisons like $::operatingsystemmajrelease < 7 will fail with:

Error: Evaluation Error: Comparison of: String < Integer, is not possible. Caused by 'A String is not comparable to a non String'.

This can be solved by using the versioncmp() function from stdlib in these situations.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (master)

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

Changed in puppet-nova:
assignee: nobody → Mike Dorman (mdorman-m)
status: New → In Progress
Changed in puppet-nova:
assignee: Mike Dorman (mdorman-m) → Gael Chamoulaud (gael-chamoulaud)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (master)

Reviewed: https://review.openstack.org/158898
Committed: https://git.openstack.org/cgit/stackforge/puppet-nova/commit/?id=a0d934b6e2adc24b32508d3c33722733ab23e8c8
Submitter: Jenkins
Branch: master

commit a0d934b6e2adc24b32508d3c33722733ab23e8c8
Author: Mike Dorman <email address hidden>
Date: Tue Feb 24 15:33:43 2015 -0700

    Use versioncmp for ::operatingsystemmajrelease comparison

    Use the stdlib versioncmp() function for comparisons of the
    ::operatingsystemmajrelease fact. If that fact evaluates to a string,
    regular arithmetric comparisons will fail under the Puppet 4.x
    language.

    Change-Id: I021fd79c2f10244c9e47284a1d5b7ca331593fc0
    Closes-bug: 1425300

Changed in puppet-nova:
status: In Progress → Fix Committed
Mathieu Gagné (mgagne)
Changed in puppet-nova:
milestone: none → 6.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-cinder (master)

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

Changed in puppet-cinder:
assignee: nobody → Gael Chamoulaud (gael-chamoulaud)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-manila (master)

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

Changed in puppet-manila:
assignee: nobody → Gael Chamoulaud (gael-chamoulaud)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-cinder (master)

Reviewed: https://review.openstack.org/168700
Committed: https://git.openstack.org/cgit/stackforge/puppet-cinder/commit/?id=5a02533d7cd52ec56d2294d05ebe9344925ebded
Submitter: Jenkins
Branch: master

commit 5a02533d7cd52ec56d2294d05ebe9344925ebded
Author: Gael Chamoulaud <email address hidden>
Date: Sun Mar 29 15:58:24 2015 +0200

    Use versioncmp for '::operatingsystemmajrelease' comparison

    Use the builtin versioncmp() function for comparisons of the
    '::operatingsystemmajrelease' fact. If that fact evaluates to a string,
    regular arithmetric comparisons will fail under the Puppet 4.x
    language.

    Change-Id: Ib55dabd3c33f5773ac3ca67955e0f85418ec0698
    Closes-bug: 1425300
    Signed-off-by: Gael Chamoulaud <email address hidden>

Changed in puppet-cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-manila (master)

Reviewed: https://review.openstack.org/168702
Committed: https://git.openstack.org/cgit/stackforge/puppet-manila/commit/?id=e6793157aef4d108682cbf40354d07a44b0ec8c9
Submitter: Jenkins
Branch: master

commit e6793157aef4d108682cbf40354d07a44b0ec8c9
Author: Gael Chamoulaud <email address hidden>
Date: Sun Mar 29 16:36:52 2015 +0200

    Use versioncmp for '::operatingsystemmajrelease' comparison

    Use the builtin versioncmp() function for comparisons of the
    '::operatingsystemmajrelease' fact. If that fact evaluates to a string,
    regular arithmetric comparisons will fail under the Puppet 4.x
    language.

    Change-Id: I9ef21e97413b3ef2a375a80fe32b072a47d37a22
    Closes-bug: 1425300
    Signed-off-by: Gael Chamoulaud <email address hidden>

Changed in puppet-manila:
status: In Progress → Fix Committed
Mathieu Gagné (mgagne)
Changed in puppet-cinder:
milestone: none → 6.0.0
Revision history for this message
Gael Chamoulaud (gael-chamoulaud) wrote :

Reviewed: https://review.openstack.org/#/c/169237/
Committed: http://git.openstack.org/cgit/stackforge/puppet-openstacklib/commit/?id=cba7bf6fa86a928bbf7959978018398ccc53c38c
Branch: master

commit cba7bf6fa86a928bbf7959978018398ccc53c38c
Author: Gael Chamoulaud <email address hidden>
Date: 2015-03-31 09:54:23 (GMT)

    Use versioncmp for '::operatingsystemmajrelease' comparison

    Use the builtin versioncmp() function for comparisons of the
    '::operatingsystemmajrelease' fact. If that fact evaluates to a string,
    regular arithmetric comparisons will fail under the Puppet 4.x
    language.

    Change-Id: Ic66516a5548be0fe6f6fb818d04086cf234f2fc1
    Closes-bug: 1425300
    Signed-off-by: Gael Chamoulaud <email address hidden>

Changed in puppet-openstacklib:
assignee: nobody → Gael Chamoulaud (gael-chamoulaud)
status: New → Fix Committed
Matt Fischer (mfisch)
Changed in puppet-cinder:
status: Fix Committed → Fix Released
Changed in puppet-manila:
status: Fix Committed → Fix Released
Changed in puppet-nova:
status: Fix Committed → Fix Released
Changed in puppet-openstacklib:
status: Fix Committed → Fix Released
Mathieu Gagné (mgagne)
Changed in puppet-cinder:
status: Fix Released → Fix Committed
Changed in puppet-manila:
status: Fix Released → Fix Committed
Changed in puppet-openstacklib:
status: Fix Released → Fix Committed
Changed in puppet-nova:
status: Fix Released → Fix Committed
Changed in puppet-openstacklib:
milestone: none → 6.0.0
Mathieu Gagné (mgagne)
Changed in puppet-cinder:
status: Fix Committed → Fix Released
Changed in puppet-nova:
status: Fix Committed → Fix Released
Changed in puppet-openstacklib:
status: Fix Committed → Fix Released
Mathieu Gagné (mgagne)
Changed in puppet-manila:
milestone: none → 6.0.0
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.