foreman_omaha 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ad84de9035d283fda62edcb31c461f88ef3811ce4caa64c2f7b299ec9c20474
4
- data.tar.gz: 3884e00feb8dff9ca2409006709f344e7085085b11e923058188101b8a196022
3
+ metadata.gz: 7d8c9488f648e7425b5ba2acf08a407e653a670247f2d2f0d1e523ed5269f5ca
4
+ data.tar.gz: 340dae98a746ac79888fb44cb939545bf971e97941034d6edeb0aee250b97a28
5
5
  SHA512:
6
- metadata.gz: c0a3e1ffe8c2d3fee38ccc48edfed5ed12e9416fd123378c08f92772386efec252bcf5f2615539d1667292c439e95535f06133700df04f94529a482a6068cdf6
7
- data.tar.gz: efd82da861cc6e7a6515136df34c4cfc46cd6eb7b6d3a5f480468778bdce57fcab7142c0d0cb9f50587cfda96f26f7bfbddc301681101e22e2424cc35eb667ce
6
+ metadata.gz: accbd7e167c73ed028e36f493fe740cc3a1df3ae175c55c278288d5db23c194ce24b0adbbc37d21c1044a32d0ab3c41a43c656d40c70b079d3ae4d140394fdc8
7
+ data.tar.gz: 837d798f8867213463f2140b70c20e76b16f21ea88cba53b687547bcde42a41fe02c45ab1f12c91970c3e8f4a87be52912f1f213b96f1bda6f8da2b7e18f5176
data/README.md CHANGED
@@ -10,6 +10,7 @@ Foreman core already supports deploying CoreOS hosts and is great for on-premise
10
10
  | --------------- | -------------- |
11
11
  | >= 1.12 | ~> 0.0 |
12
12
  | >= 1.17 | ~> 1.0 |
13
+ | >= 1.18 | ~> 2.0 |
13
14
 
14
15
  ## Installation
15
16
 
@@ -16,8 +16,6 @@ class OmahaGroupsController < ApplicationController
16
16
  @oem_distribution = ForemanOmaha::Charts::OemDistribution.new(@omaha_group.hosts)
17
17
  end
18
18
 
19
- private
20
-
21
19
  def model_of_controller
22
20
  ::ForemanOmaha::OmahaGroup
23
21
  end
@@ -8,6 +8,7 @@ class OmahaReportsController < ApplicationController
8
8
  end
9
9
 
10
10
  def index
11
+ @host = resource_finder(Host.authorized(:view_hosts), params[:host_id]) if params[:host_id]
11
12
  @omaha_reports = resource_base_search_and_page(:host)
12
13
  end
13
14
 
@@ -22,7 +22,12 @@ module ForemanOmaha
22
22
  end
23
23
 
24
24
  def latest_operatingsystem
25
- operatingsystems.order(:major, :minor).last
25
+ case database_adapter_type
26
+ when :postgresql
27
+ operatingsystems.reorder('').order('major::text::integer DESC').order('minor::text::float DESC').limit(1).last
28
+ else
29
+ operatingsystems.reorder('').order(:major, :minor).last
30
+ end
26
31
  end
27
32
 
28
33
  private
@@ -30,5 +35,9 @@ module ForemanOmaha
30
35
  def ensure_uuid
31
36
  self.uuid ||= SecureRandom.uuid
32
37
  end
38
+
39
+ def database_adapter_type
40
+ ActiveRecord::Base.connection.adapter_name.downcase.to_sym
41
+ end
33
42
  end
34
43
  end
@@ -37,7 +37,7 @@ module ForemanOmaha
37
37
  os = previous_version.deep_clone(
38
38
  :include => [:ptables, :media, :os_default_templates, :architectures]
39
39
  )
40
- os.update_attributes(attrs)
40
+ os.update(attrs)
41
41
  os
42
42
  end
43
43
 
@@ -1,15 +1,6 @@
1
1
  <% javascript 'foreman_omaha/application' %>
2
2
  <% javascript 'charts' %>
3
- <div class="container-fluid">
4
- <div class="row">
5
- <div class="col-md-12">
6
- <ol class="breadcrumb">
7
- <li class="breadcrumb-item"><%= link_to_if_authorized(_("Omaha Groups"), hash_for_omaha_groups_path) %></li>
8
- <li class="breadcrumb-item active"><strong><%= @omaha_group.name %></strong></li>
9
- </ol>
10
- </div>
11
- </div>
12
- </div>
3
+ <% title @omaha_group.name %>
13
4
  <div class="container-fluid container-cards-pf">
14
5
  <!-- status cards -->
15
6
  <div class="row row-cards-pf">
@@ -134,7 +125,7 @@
134
125
  </div>
135
126
  <div class="card-pf-body">
136
127
  <% if @out_of_sync.count > 0 %>
137
- <table class="table table-striped table-condensed table-fixed">
128
+ <table class="<%=table_css_classes 'table-condensed table-fixed' %>">
138
129
  <thead>
139
130
  <tr>
140
131
  <th><%= _('Host') %></th>
@@ -20,7 +20,7 @@
20
20
  <% if host.operatingsystem %>
21
21
  <div class="list-view-pf-additional-info-item">
22
22
  <%= icon(host.operatingsystem, :size => '16x16') %>&nbsp;
23
- <%= link_to_if_authorized(host.operatingsystem.release, hash_for_edit_operatingsystem_path(host.operatingsystem)) %>
23
+ <%= link_to_if_authorized(host.omaha_facet.version, hash_for_edit_operatingsystem_path(host.operatingsystem)) %>
24
24
  </div>
25
25
  <% end %>
26
26
  <div class="list-view-pf-additional-info-item" style="white-space: nowrap;">
@@ -4,7 +4,7 @@
4
4
  <%= icon_text('screen', '', :kind => 'pficon') %>
5
5
  </div>
6
6
  <h1><%= _('Omaha Hosts') %></h1>
7
- <p><%= _("You don't have any visible hosts that have reported to Foreman. CoreOS Hosts can be added and provisioned from Foreman and configured to report to Foreman.") %></p>
7
+ <p><%= _("You don't have any visible hosts that have reported to Foreman. Container Linux Hosts can be added and provisioned from Foreman or just configured to report to Foreman.") %></p>
8
8
  <p><%= link_to _('Learn more about this in the documentation.'), 'https://github.com/theforeman/foreman_omaha', :rel => 'external' %></p>
9
9
  <div class="blank-slate-pf-main-action">
10
10
  <%= new_link(_('Create Host'), { :controller => :hosts, :action => :new }, { :class => 'btn-lg' }) %>
@@ -1,2 +1,18 @@
1
+ <%= breadcrumbs(
2
+ items: [
3
+ {
4
+ caption: _('Hosts'),
5
+ url: (url_for(hosts_path) if authorized_for(hash_for_hosts_path))
6
+ },
7
+ {
8
+ caption: @host.name,
9
+ url: (host_path(@host) if authorized_for(hash_for_host_path(@host)))
10
+ },
11
+ {
12
+ caption: _('Omaha Reports'),
13
+ url: url_for(host_omaha_reports_path(@host))
14
+ },
15
+ ]
16
+ ) if @host %>
1
17
  <% title _("Omaha Reports") %>
2
18
  <%= render :partial => 'list' %>
@@ -1,5 +1,6 @@
1
1
  <%= javascript 'reports' %>
2
2
  <% title "#{@omaha_report.host}"%>
3
+ <% breadcrumbs(switchable: false) %>
3
4
 
4
5
  <p class='ra'> <%= _("Reported at %s ") % @omaha_report.reported_at %> </p>
5
6
  <% if @offset > 10 %>
@@ -4,9 +4,9 @@
4
4
  </div>
5
5
  <h1><%= _('Omaha Reports') %></h1>
6
6
  <p>
7
- <%= _("You don't seem to have any omaha reports.") %></br>
8
- <%= _('If you wish to configure CoreOS to forward reports to Foreman, please follow') %>
9
- <%= link_to _("the documentation"), 'https://github.com/timogoebel/foreman_omaha', :rel => "external" %>.
7
+ <%= _("You don't seem to have any Omaha reports.") %></br>
8
+ <%= _('If you wish to configure Container Linux to forward reports to Foreman, please follow') %>
9
+ <%= link_to _("the documentation"), 'https://github.com/theforeman/foreman_omaha', :rel => 'external' %>.
10
10
  </p>
11
11
  <div class="blank-slate-pf-main-action">
12
12
  <%= link_to _('Documentation'), 'https://github.com/theforeman/foreman_omaha', :rel => 'external', :class => 'btn btn-primary btn-lg' %>
@@ -18,7 +18,7 @@ module ForemanOmaha
18
18
 
19
19
  initializer 'foreman_omaha.register_plugin', :before => :finisher_hook do |_app|
20
20
  Foreman::Plugin.register :foreman_omaha do
21
- requires_foreman '>= 1.17'
21
+ requires_foreman '>= 1.18'
22
22
 
23
23
  apipie_documented_controllers ["#{ForemanOmaha::Engine.root}/app/controllers/api/v2/*.rb"]
24
24
 
@@ -114,20 +114,6 @@ module ForemanOmaha
114
114
  end
115
115
  end
116
116
 
117
- # Precompile any JS, Stylesheet or Image files under app/assets/
118
- assets_to_precompile =
119
- Dir.chdir(root) do
120
- Dir['app/assets/javascripts/**/*', 'app/assets/images/**/*', 'app/assets/stylesheets/**/*'].map do |f|
121
- f.split(File::SEPARATOR, 4).last
122
- end
123
- end
124
- initializer 'foreman_omaha.assets.precompile' do |app|
125
- app.config.assets.precompile += assets_to_precompile
126
- end
127
- initializer 'foreman_omaha.configure_assets', group: :assets do
128
- SETTINGS[:foreman_omaha] = { assets: { precompile: assets_to_precompile } }
129
- end
130
-
131
117
  rake_tasks do
132
118
  Rake::Task['db:seed'].enhance do
133
119
  ForemanOmaha::Engine.load_seed
@@ -135,7 +121,7 @@ module ForemanOmaha
135
121
  end
136
122
 
137
123
  initializer 'foreman_omaha.register_gettext', after: :load_config_initializers do |_app|
138
- locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale')
124
+ locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
139
125
  locale_domain = 'foreman_omaha'
140
126
  Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
141
127
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanOmaha
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_omaha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-15 00:00:00.000000000 Z
11
+ date: 2018-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-matchheight-rails
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.52.0
47
+ version: 0.54.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.52.0
54
+ version: 0.54.0
55
55
  description: This plug-in adds support for the Omaha procotol to The Foreman. It allows
56
56
  you to better manage and update your CoreOS servers.
57
57
  email:
@@ -174,22 +174,22 @@ signing_key:
174
174
  specification_version: 4
175
175
  summary: This plug-in adds support for the Omaha procotol to The Foreman.
176
176
  test_files:
177
- - test/factories/feature.rb
178
- - test/factories/foreman_omaha_factories.rb
179
- - test/factories/host.rb
180
- - test/factories/smart_proxy.rb
181
- - test/functional/api/v2/omaha_groups_controller_test.rb
182
- - test/functional/api/v2/omaha_reports_controller_test.rb
183
- - test/functional/omaha_groups_controller_test.rb
184
- - test/functional/omaha_hosts_controller_test.rb
185
- - test/functional/omaha_reports_controller_test.rb
186
- - test/test_plugin_helper.rb
177
+ - test/unit/omaha_fact_parser_test.rb
178
+ - test/unit/charts/version_distribution_test.rb
187
179
  - test/unit/charts/oem_distribution_test.rb
188
180
  - test/unit/charts/status_distribution_test.rb
189
- - test/unit/charts/version_distribution_test.rb
190
181
  - test/unit/group_version_breakdown_test.rb
191
- - test/unit/host_status/omaha_status_test.rb
192
182
  - test/unit/host_test.rb
193
- - test/unit/omaha_fact_parser_test.rb
194
- - test/unit/omaha_report_test.rb
183
+ - test/unit/host_status/omaha_status_test.rb
195
184
  - test/unit/renderer_test.rb
185
+ - test/unit/omaha_report_test.rb
186
+ - test/factories/smart_proxy.rb
187
+ - test/factories/feature.rb
188
+ - test/factories/host.rb
189
+ - test/factories/foreman_omaha_factories.rb
190
+ - test/test_plugin_helper.rb
191
+ - test/functional/omaha_groups_controller_test.rb
192
+ - test/functional/omaha_hosts_controller_test.rb
193
+ - test/functional/api/v2/omaha_groups_controller_test.rb
194
+ - test/functional/api/v2/omaha_reports_controller_test.rb
195
+ - test/functional/omaha_reports_controller_test.rb