Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use int for support range; force integer cast #29

Merged
merged 2 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/workers/repo_status_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ def perform
data.supports_eol_ubuntu << repo if os['operatingsystemrelease'].min < UBUNTU_SUPPORT_RANGE.min
data.doesnt_support_latest_ubuntu << repo if os['operatingsystemrelease'].max < UBUNTU_SUPPORT_RANGE.max
when 'Debian'
data.supports_eol_debian << repo if os['operatingsystemrelease'].min < DEBIAN_SUPPORT_RANGE.min
data.doesnt_support_latest_debian << repo if os['operatingsystemrelease'].max < DEBIAN_SUPPORT_RANGE.max
data.supports_eol_debian << repo if os['operatingsystemrelease'].all_i.min < DEBIAN_SUPPORT_RANGE.all_i.min
data.doesnt_support_latest_debian << repo if os['operatingsystemrelease'].all_i.max < DEBIAN_SUPPORT_RANGE.all_i.max
when 'CentOS', 'RedHat'
data.supports_eol_centos << repo if os['operatingsystemrelease'].min < CENTOS_SUPPORT_RANGE.min
data.doesnt_support_latest_centos << repo if os['operatingsystemrelease'].max < CENTOS_SUPPORT_RANGE.max
data.supports_eol_centos << repo if os['operatingsystemrelease'].all_i.min < CENTOS_SUPPORT_RANGE.all_i.min
data.doesnt_support_latest_centos << repo if os['operatingsystemrelease'].all_i.max < CENTOS_SUPPORT_RANGE.all_i.max
end
end
rescue NoMethodError
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/array.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Array
def all_i
self.map(&:to_i)
end
end
4 changes: 2 additions & 2 deletions config/initializers/voxpupuli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# https://tickets.puppetlabs.com/browse/PA-1869
# https://github.com/camptocamp/facterdb/pull/82#event-1600066178
UBUNTU_SUPPORT_RANGE = ['14.04', '16.04', '18.04']
DEBIAN_SUPPORT_RANGE = ['8', '9', '10']
CENTOS_SUPPORT_RANGE = ['6', '7']
DEBIAN_SUPPORT_RANGE = [8, 9, 10]
CENTOS_SUPPORT_RANGE = [6, 7]