foreman_virt_who_configure 0.5.23 → 0.5.24

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: 119cc91cb905da4bd294432142b61ac910531ae8e34cdb0a6e7223a932894b32
4
- data.tar.gz: a2e875685992c24bbadbf43cb3337cddefa7fcafa3ea592f7afa59026fec1e73
3
+ metadata.gz: '0486a196b4c78fe513762dcd53fc4fad62c15811c42f2b2d15aa5de04f77a695'
4
+ data.tar.gz: a563363ed91d36d18c593f51bba58bc574670a2724f14e710a37bcd390555c43
5
5
  SHA512:
6
- metadata.gz: cf72c11793e7157e197b8728be459ca702d5a030325445300f8b70ac010a43c03fa3064d46637c9727673796647e0a6e0ce709e6a3c4a7f30043fc17af815261
7
- data.tar.gz: 5c0707b56eb0aa13bc1379d473fb207d35015c28531ca945b0396ac650f8d4f3d55176c38cbdc6667aa12428b6dc42f8c31218b766a71ac50fbe829923b269bc
6
+ metadata.gz: a79cc021acba1a95b90c4636c8741169466498f17000c8778b92956a1522e28d939dcb53e88702e29391662e3f6d74d87dbe8eb7a81d99f78665b146347f2b54
7
+ data.tar.gz: 9e3a8d98ab7bd30db563e003f3ab0cea7c8aa49046187cddcc612fbae19d24eae1edc7e5865c765c17dc540dcdb43b429c522046051b66cb4654b9a458511db7
@@ -0,0 +1,3 @@
1
+ Rails.autoloaders.main.ignore(
2
+ ForemanVirtWhoConfigure::Engine.root.join('lib/tasks')
3
+ )
@@ -1,4 +1,4 @@
1
- class AddSatelliteUrlToConfig < ActiveRecord::Migration[4.2]
1
+ class AddSatelliteURLToConfig < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :foreman_virt_who_configure_configs, :satellite_url, :string, :null => true
4
4
  end
@@ -4,12 +4,6 @@ module ForemanVirtWhoConfigure
4
4
  class Engine < ::Rails::Engine
5
5
  engine_name 'foreman_virt_who_configure'
6
6
 
7
- config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
8
- config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
9
- config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
10
- config.autoload_paths += Dir["#{config.root}/app/lib"]
11
- config.autoload_paths += Dir["#{config.root}/test/"]
12
-
13
7
  # Add any db migrations
14
8
  initializer 'foreman_virt_who_configure.load_app_instance_data' do |app|
15
9
  ForemanVirtWhoConfigure::Engine.paths['db/migrate'].existent.each do |path|
@@ -25,58 +19,60 @@ module ForemanVirtWhoConfigure
25
19
  Apipie.configuration.checksum_path += ['/api/']
26
20
  end
27
21
 
28
- initializer 'foreman_virt_who_configure.register_plugin', :before => :finisher_hook do |_app|
29
- Foreman::Plugin.register :foreman_virt_who_configure do
30
- requires_foreman '>= 3.7'
31
- register_gettext
32
-
33
- apipie_documented_controllers ["#{ForemanVirtWhoConfigure::Engine.root}/app/controllers/foreman_virt_who_configure/api/v2/*.rb"]
34
-
35
- # Add permissions
36
- security_block :foreman_virt_who_configure do
37
- permission_options = { :resource_type => 'ForemanVirtWhoConfigure::Config' }
38
- permission :view_virt_who_config, { :'foreman_virt_who_configure/configs' => [:index, :show, :auto_complete_search, :deploy_script],
39
- :'foreman_virt_who_configure/api/v2/configs' => [:index, :show, :deploy_script] }, permission_options
40
- permission :create_virt_who_config, { :'foreman_virt_who_configure/configs' => [:new, :create],
41
- :'foreman_virt_who_configure/api/v2/configs' => [:create] }, permission_options
42
- permission :edit_virt_who_config, { :'foreman_virt_who_configure/configs' => [:edit, :update],
43
- :'foreman_virt_who_configure/api/v2/configs' => [:update] }, permission_options
44
- permission :destroy_virt_who_config, { :'foreman_virt_who_configure/configs' => [:destroy],
45
- :'foreman_virt_who_configure/api/v2/configs' => [:destroy] }, permission_options
46
- end
22
+ initializer 'foreman_virt_who_configure.register_plugin', :before => :finisher_hook do |app|
23
+ app.reloader.to_prepare do
24
+ Foreman::Plugin.register :foreman_virt_who_configure do
25
+ requires_foreman '>= 3.13'
26
+ register_gettext
27
+
28
+ apipie_documented_controllers ["#{ForemanVirtWhoConfigure::Engine.root}/app/controllers/foreman_virt_who_configure/api/v2/*.rb"]
29
+
30
+ # Add permissions
31
+ security_block :foreman_virt_who_configure do
32
+ permission_options = { :resource_type => 'ForemanVirtWhoConfigure::Config' }
33
+ permission :view_virt_who_config, { :'foreman_virt_who_configure/configs' => [:index, :show, :auto_complete_search, :deploy_script],
34
+ :'foreman_virt_who_configure/api/v2/configs' => [:index, :show, :deploy_script] }, permission_options
35
+ permission :create_virt_who_config, { :'foreman_virt_who_configure/configs' => [:new, :create],
36
+ :'foreman_virt_who_configure/api/v2/configs' => [:create] }, permission_options
37
+ permission :edit_virt_who_config, { :'foreman_virt_who_configure/configs' => [:edit, :update],
38
+ :'foreman_virt_who_configure/api/v2/configs' => [:update] }, permission_options
39
+ permission :destroy_virt_who_config, { :'foreman_virt_who_configure/configs' => [:destroy],
40
+ :'foreman_virt_who_configure/api/v2/configs' => [:destroy] }, permission_options
41
+ end
47
42
 
48
- reporter_permissions = [:create_hosts, :edit_hosts, :view_lifecycle_environments, :my_organizations]
49
- begin
50
- if Permission.where(:name => ['create_content_hosts', 'edit_content_hosts']).count > 0
51
- # old Katello permissions detected (6.2 era)
52
- reporter_permissions += [:create_content_hosts, :edit_content_hosts]
43
+ reporter_permissions = [:create_hosts, :edit_hosts, :view_lifecycle_environments, :my_organizations]
44
+ begin
45
+ if Permission.where(:name => ['create_content_hosts', 'edit_content_hosts']).count > 0
46
+ # old Katello permissions detected (6.2 era)
47
+ reporter_permissions += [:create_content_hosts, :edit_content_hosts]
48
+ end
49
+ rescue ActiveRecord::StatementInvalid
50
+ # permissions could not be loaded, probably migration hasn't been run yet
53
51
  end
54
- rescue ActiveRecord::StatementInvalid
55
- # permissions could not be loaded, probably migration hasn't been run yet
56
- end
57
52
 
58
- begin
59
- role 'Virt-who Reporter', reporter_permissions, 'Role granting minimal set of permissions for virt-who to upload the report, it can be used if you configure virt-who manually and want to use user that has locked down account.'
60
- rescue ArgumentError
61
- # could not configure role, some permissions are missing
62
- end
53
+ begin
54
+ role 'Virt-who Reporter', reporter_permissions, 'Role granting minimal set of permissions for virt-who to upload the report, it can be used if you configure virt-who manually and want to use user that has locked down account.'
55
+ rescue ArgumentError
56
+ # could not configure role, some permissions are missing
57
+ end
63
58
 
64
- role 'Virt-who Manager', [:view_virt_who_config, :create_virt_who_config, :edit_virt_who_config, :destroy_virt_who_config], 'Role granting all permissions to manage virt-who configurations, user needs this role to create, delete or update configurations.'
59
+ role 'Virt-who Manager', [:view_virt_who_config, :create_virt_who_config, :edit_virt_who_config, :destroy_virt_who_config], 'Role granting all permissions to manage virt-who configurations, user needs this role to create, delete or update configurations.'
65
60
 
66
- role 'Virt-who Viewer', [:view_virt_who_config], 'Role granting permissions to see all configurations including their configuration scripts, which means viewers could still deploy the virt-who instances for existing virt-who configurations.'
61
+ role 'Virt-who Viewer', [:view_virt_who_config], 'Role granting permissions to see all configurations including their configuration scripts, which means viewers could still deploy the virt-who instances for existing virt-who configurations.'
67
62
 
68
- # Available since Foreman 1.15
69
- add_all_permissions_to_default_roles if respond_to?(:add_all_permissions_to_default_roles)
63
+ # Available since Foreman 1.15
64
+ add_all_permissions_to_default_roles if respond_to?(:add_all_permissions_to_default_roles)
70
65
 
71
- # add menu entry
72
- menu :top_menu, :virt_who_configs,
73
- url_hash: { controller: 'foreman_virt_who_configure/configs', action: :index },
74
- caption: N_('Virt-who Configurations'),
75
- parent: :infrastructure_menu,
76
- after: :compute_resources
66
+ # add menu entry
67
+ menu :top_menu, :virt_who_configs,
68
+ url_hash: { controller: 'foreman_virt_who_configure/configs', action: :index },
69
+ caption: N_('Virt-who Configurations'),
70
+ parent: :infrastructure_menu,
71
+ after: :compute_resources
77
72
 
78
- # add dashboard widget
79
- widget 'foreman_virt_who_configs_status_widget', :name => N_('Virt-who Configs Status'), sizex: 6, sizey: 1
73
+ # add dashboard widget
74
+ widget 'foreman_virt_who_configs_status_widget', :name => N_('Virt-who Configs Status'), sizex: 6, sizey: 1
75
+ end
80
76
  end
81
77
  end
82
78
 
@@ -1,3 +1,3 @@
1
1
  module ForemanVirtWhoConfigure
2
- VERSION = '0.5.23'.freeze
2
+ VERSION = '0.5.24'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_virt_who_configure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.23
4
+ version: 0.5.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman virt-who-configure team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-20 00:00:00.000000000 Z
11
+ date: 2024-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -133,6 +133,7 @@ files:
133
133
  - app/views/foreman_virt_who_configure/configs/steps/_schedule_form.erb
134
134
  - app/views/foreman_virt_who_configure/configs/welcome.html.erb
135
135
  - config/database.yml.example
136
+ - config/initializers/zeitwerk.rb
136
137
  - config/routes.rb
137
138
  - db/migrate/20170102152649_create_service_users.rb
138
139
  - db/migrate/20170102152650_create_configs.rb