From cba7bf6fa86a928bbf7959978018398ccc53c38c Mon Sep 17 00:00:00 2001 From: Gael Chamoulaud Date: Tue, 31 Mar 2015 11:54:23 +0200 Subject: [PATCH] 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 --- manifests/db/postgresql.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 18fc3059..febbb440 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -32,8 +32,8 @@ define openstacklib::db::postgresql ( $privileges = 'ALL', ){ - if ((($::operatingsystem == 'RedHat' or $::operatingsystem == 'CentOS') and $::operatingsystemmajrelease <= 6) - or ($::operatingsystem == 'Fedora' and $::operatingsystemmajrelease <= 14)) { + if ((($::operatingsystem == 'RedHat' or $::operatingsystem == 'CentOS') and (versioncmp($::operatingsystemmajrelease, '6') <= 0)) + or ($::operatingsystem == 'Fedora' and (versioncmp($::operatingsystemmajrelease, '14') <= 0))) { warning('The system packages handling the postgresql infrastructure for OpenStack are out of date and should not be relied on for database migrations.') }