foreman_discovery 9.0.0 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/discovered_hosts_controller.rb +6 -4
- data/app/controllers/api/v2/fact_values_controller_extensions.rb +2 -2
- data/app/controllers/concerns/foreman/controller/discovered_extensions.rb +6 -1
- data/app/controllers/discovered_hosts_controller.rb +2 -2
- data/app/helpers/discovered_hosts_helper.rb +5 -0
- data/app/models/discovery_attribute_set.rb +1 -1
- data/app/models/discovery_rule.rb +1 -1
- data/app/models/host/discovered.rb +3 -2
- data/app/models/host/managed_extensions.rb +10 -5
- data/app/services/foreman_discovery/host_converter.rb +0 -2
- data/app/views/api/v2/discovery_rules/main.json.rabl +12 -0
- data/app/views/discovered_hosts/_discovered_host_modal.html.erb +2 -2
- data/app/views/discovered_hosts/_discovered_hosts_list.html.erb +5 -5
- data/app/views/discovered_hosts/edit.html.erb +3 -0
- data/app/views/discovery_rules/_form.html.erb +1 -1
- data/app/views/discovery_rules/index.html.erb +2 -2
- data/app/views/foreman_discovery/debian_kexec.erb +1 -0
- data/app/views/foreman_discovery/redhat_kexec.erb +1 -0
- data/config/routes.rb +3 -3
- data/db/migrate/20141223142759_fill_discovery_attribute_sets_for_existing_hosts.rb +1 -1
- data/db/migrate/20160818091421_add_permissions_from_default_roles.rb +1 -7
- data/db/seeds.d/50_discovery_templates.rb +2 -2
- data/db/seeds.d/60_discovery_proxy_feature.rb +2 -2
- data/db/seeds.d/70_discovery_mail_notification.rb +1 -1
- data/db/seeds.d/90_add_permissions_from_default_roles.rb +12 -0
- data/lib/foreman_discovery/engine.rb +3 -2
- data/lib/foreman_discovery/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ca/foreman_discovery.edit.po +37 -28
- data/locale/ca/foreman_discovery.po +14 -8
- data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/de/foreman_discovery.edit.po +38 -29
- data/locale/de/foreman_discovery.po +15 -9
- data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/en/foreman_discovery.edit.po +62 -38
- data/locale/en/foreman_discovery.po +27 -9
- data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/en_GB/foreman_discovery.edit.po +37 -28
- data/locale/en_GB/foreman_discovery.po +14 -8
- data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/es/foreman_discovery.edit.po +37 -28
- data/locale/es/foreman_discovery.po +14 -8
- data/locale/foreman_discovery.pot +63 -41
- data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/fr/foreman_discovery.edit.po +38 -29
- data/locale/fr/foreman_discovery.po +15 -9
- data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/gl/foreman_discovery.edit.po +36 -27
- data/locale/gl/foreman_discovery.po +14 -8
- data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/it/foreman_discovery.edit.po +37 -28
- data/locale/it/foreman_discovery.po +14 -8
- data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ja/foreman_discovery.edit.po +37 -28
- data/locale/ja/foreman_discovery.po +14 -8
- data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ko/foreman_discovery.edit.po +37 -28
- data/locale/ko/foreman_discovery.po +14 -8
- data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/pt_BR/foreman_discovery.edit.po +37 -28
- data/locale/pt_BR/foreman_discovery.po +14 -8
- data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ru/foreman_discovery.edit.po +37 -28
- data/locale/ru/foreman_discovery.po +14 -8
- data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/sv_SE/foreman_discovery.edit.po +36 -27
- data/locale/sv_SE/foreman_discovery.po +14 -8
- data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/zh_CN/foreman_discovery.edit.po +37 -28
- data/locale/zh_CN/foreman_discovery.po +14 -8
- data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/zh_TW/foreman_discovery.edit.po +37 -28
- data/locale/zh_TW/foreman_discovery.po +14 -8
- data/test/factories/discovery_host_related.rb +26 -0
- data/test/factories/discovery_rule_related.rb +0 -27
- data/test/functional/api/v2/discovered_hosts_controller_test.rb +8 -6
- data/test/functional/api/v2/discovery_rules_controller_test.rb +5 -2
- data/test/functional/api/v2/fact_value_extensions_test.rb +2 -2
- data/test/functional/discovered_hosts_controller_test.rb +114 -78
- data/test/functional/discovery_rules_controller_test.rb +1 -1
- data/test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb +0 -1
- data/test/test_helper_discovery.rb +42 -6
- data/test/test_plugin_helper.rb +2 -0
- data/test/unit/discovered_extensions_test.rb +55 -10
- data/test/unit/discovery_attribute_set_test.rb +1 -1
- data/test/unit/discovery_rule_test.rb +1 -1
- data/test/unit/discovery_taxonomy_extensions_test.rb +1 -1
- data/test/unit/fact_parser_test.rb +1 -1
- data/test/unit/host_discovered_test.rb +48 -3
- data/test/unit/managed_extensions_test.rb +76 -0
- data/test/unit/setting_discovered_test.rb +1 -1
- data/test/unit/ui_notifications/destroy_host_test.rb +0 -1
- metadata +25 -23
- data/app/models/concerns/fact_value_extensions.rb +0 -13
- data/test/test_helper.rb +0 -25
- data/test/unit/fact_value_extensions_test.rb +0 -11
@@ -1,13 +0,0 @@
|
|
1
|
-
module FactValueExtensions
|
2
|
-
extend ActiveSupport::Concern
|
3
|
-
|
4
|
-
included do
|
5
|
-
belongs_to :discovered_host, :class_name => "Host::Discovered", :foreign_key => :host_id
|
6
|
-
scoped_search :relation => :discovered_host, :on => :id, :complete_enabled => false, :only_explicit => true, :rename => :discovered_host
|
7
|
-
|
8
|
-
def host
|
9
|
-
return discovered_host if discovered_host.present?
|
10
|
-
super
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler/setup'
|
3
|
-
|
4
|
-
ENV["RAILS_ENV"] ||= 'test'
|
5
|
-
|
6
|
-
require 'test/unit'
|
7
|
-
require 'foreman_discovery'
|
8
|
-
require 'rails/test_help'
|
9
|
-
|
10
|
-
Rails.backtrace_cleaner.remove_silencers!
|
11
|
-
|
12
|
-
class ActiveSupport::TestCase
|
13
|
-
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
14
|
-
#
|
15
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
16
|
-
# -- they do not yet inherit this setting
|
17
|
-
|
18
|
-
foreman_dir = File.expand_path("../../.foreman_app", File.join(Dir.pwd, __FILE__))
|
19
|
-
fixture_path=File.join(foreman_dir, "test/fixtures")
|
20
|
-
fixtures :all
|
21
|
-
|
22
|
-
set_fixture_class({ :hosts => Host::Base })
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'test_helper_discovery'
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class FactValueExtensionsTest < ActiveSupport::TestCase
|
4
|
-
describe '.host' do
|
5
|
-
test 'returns discovered_host' do
|
6
|
-
discovered_host = FactoryGirl.create(:discovered_host, :with_facts, :fact_count => 1)
|
7
|
-
fact_value = discovered_host.fact_values.first
|
8
|
-
assert fact_value.discovered_host, fact_value.host
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|