Puppet Function: mq_install::fixpack_downgrade
- Defined in:
- lib/puppet/functions/mq_install/fixpack_downgrade.rb
- Function type:
- Ruby 4.x API
Overview
Function to determine if we need a fixpack downgrade. We do this based on the current version and the requested version
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/puppet/functions/mq_install/fixpack_downgrade.rb', line 5 Puppet::Functions.create_function('mq_install::fixpack_downgrade') do # # See the file "LICENSE" for the full license governing this code. # # # @param current_version The currently installed fixpack version. # @param requested_version The requested fixpack version. # @return If current_version is higher than the requested version return true. Else false # dispatch :fixpack_downgrade do required_param 'String', :current_version required_param 'String', :requested_version return_type 'Boolean' end def fixpack_downgrade(current_version, requested_version) return false if current_version == 'not-installed' current_major, current_minor, = current_version.split('.') requested_major, requested_minor, = requested_version.split('.') fail 'Incompatible MQ versions specified for fixpack. Major and minor versions need to be same' if current_major != requested_major || current_minor != requested_minor Gem::Version.new(requested_version) < Gem::Version.new(current_version) end end |