foreman_ansible 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of foreman_ansible might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7394d81e94f7dd6bfda57b0a539adc09a1c068e0
4
- data.tar.gz: 87475c40db6d3a594517de1443878ffe107b85f6
3
+ metadata.gz: 171a0853e2f5429814160c53ebad9511bf38420d
4
+ data.tar.gz: e6921e84713038550370c6af692ee7a5db632a6d
5
5
  SHA512:
6
- metadata.gz: 48d0c08d791d3543d6cbf2341c6a3ed66ba9c0d4b9a8c9e5bbcc0344444ef9c8c94db91ae4b7bf193ef915c75d9162470877140c46cd9d3c44e110d3593d809b
7
- data.tar.gz: 79df637cc5ce51f5f6d9ee40ae0587b18c4dc9f339ae0edd4d813dd97fcfe1965bc589d7c176fcabcbd202cd47d75a839695ed652a9636ff32e37175164e168b
6
+ metadata.gz: d83512f1d44933fe302100df714cb66c5f7dc3947b4ab7d1d93c4ea82f82f9aeaaf7a6c74307055578283849e121a8719836678cc076748951b8e90103d7e2a8
7
+ data.tar.gz: e43b9174db2e5cc4f8f265ca2ec462a1fc186e2828007d43bc4b5d84a6b70368ca632be144977e1b80a6ee94950a963acd31fa2c91004c2afa013b05460cd338
Binary file
@@ -1,3 +1,10 @@
1
1
  module ForemanAnsible
2
- class FactName < ::FactName; end
2
+ # Define the class that fact names that come from Ansible should have
3
+ # It allows us to filter facts by origin, and also to display the origin
4
+ # in the fact values table (/fact_values)
5
+ class FactName < ::FactName
6
+ def origin
7
+ 'Ansible'
8
+ end
9
+ end
3
10
  end
@@ -47,9 +47,16 @@ module ForemanAnsible
47
47
  end
48
48
 
49
49
  def missing_facts
50
+ db_fact_names = if db_facts.is_a? Hash
51
+ db_facts.keys
52
+ else
53
+ db_facts
54
+ end
55
+ # In Foreman versions prior to 1.14, the db_facts key
56
+ # used to be a hash. Now it's an ActiveRecord::AssociationRelation
50
57
  @missing_facts ||= facts.keys +
51
58
  FactSparser.sparse(@original_facts).keys -
52
- db_facts.keys
59
+ db_fact_names
53
60
  end
54
61
 
55
62
  # Returns pairs [id, fact_name]
@@ -72,6 +72,12 @@ module ForemanAnsible
72
72
  end
73
73
  end
74
74
 
75
+ initializer 'foreman_ansible.apipie' do
76
+ Apipie.configuration.api_controllers_matcher <<
77
+ "#{ForemanAnsible::Engine.root}/app/controllers/api/v2/*.rb"
78
+ Apipie.configuration.checksum_path += ['/foreman_ansible/api/']
79
+ end
80
+
75
81
  config.to_prepare do
76
82
  begin
77
83
  ::FactImporter.register_fact_importer(:ansible,
@@ -2,5 +2,5 @@
2
2
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
3
3
  # and detect what version the plugin is running.
4
4
  module ForemanAnsible
5
- VERSION = '1.1'.freeze
5
+ VERSION = '1.2'.freeze
6
6
  end
@@ -19,7 +19,7 @@ module ForemanAnsible
19
19
  test 'missing_facts returns facts we do not have in the database' do
20
20
  @fact_importer = FactImporter.new(@host, facts_json)
21
21
  @fact_importer.expects(:db_facts).
22
- returns('ansible_cmdline' => 'fakevalue')
22
+ returns('ansible_cmdline' => 'fakevalue').twice
23
23
  refute @fact_importer.send(:missing_facts).include?('ansible_cmdline')
24
24
  end
25
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -90,6 +90,7 @@ files:
90
90
  - LICENSE
91
91
  - README.md
92
92
  - Rakefile
93
+ - app/assets/images/Ansible.png
93
94
  - app/controllers/ansible_roles_controller.rb
94
95
  - app/controllers/api/v2/ansible_roles_controller.rb
95
96
  - app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb
@@ -159,15 +160,15 @@ files:
159
160
  - test/unit/ansible_role_test.rb
160
161
  - test/unit/concerns/host_managed_extensions_test.rb
161
162
  - test/unit/concerns/hostgroup_extensions_test.rb
162
- - test/unit/fact_importer_test.rb
163
- - test/unit/fact_parser_test.rb
164
- - test/unit/fact_sparser_test.rb
165
163
  - test/unit/helpers/foreman_ansible/ansible_reports_helper_test.rb
166
164
  - test/unit/host_ansible_role_test.rb
167
165
  - test/unit/hostgroup_ansible_role_test.rb
168
166
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
169
167
  - test/unit/lib/proxy_api/ansible_test.rb
170
168
  - test/unit/services/api_roles_importer_test.rb
169
+ - test/unit/services/fact_importer_test.rb
170
+ - test/unit/services/fact_parser_test.rb
171
+ - test/unit/services/fact_sparser_test.rb
171
172
  - test/unit/services/proxy_selector_test.rb
172
173
  - test/unit/services/roles_importer_test.rb
173
174
  - test/unit/services/ui_roles_importer_test.rb
@@ -207,17 +208,17 @@ test_files:
207
208
  - test/functional/ansible_roles_controller_test.rb
208
209
  - test/functional/hosts_controller_test.rb
209
210
  - test/test_plugin_helper.rb
210
- - test/unit/fact_parser_test.rb
211
211
  - test/unit/concerns/hostgroup_extensions_test.rb
212
212
  - test/unit/concerns/host_managed_extensions_test.rb
213
+ - test/unit/services/fact_parser_test.rb
213
214
  - test/unit/services/proxy_selector_test.rb
215
+ - test/unit/services/fact_importer_test.rb
214
216
  - test/unit/services/ui_roles_importer_test.rb
215
217
  - test/unit/services/roles_importer_test.rb
218
+ - test/unit/services/fact_sparser_test.rb
216
219
  - test/unit/services/api_roles_importer_test.rb
217
220
  - test/unit/host_ansible_role_test.rb
218
221
  - test/unit/ansible_role_test.rb
219
- - test/unit/fact_importer_test.rb
220
- - test/unit/fact_sparser_test.rb
221
222
  - test/unit/lib/proxy_api/ansible_test.rb
222
223
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
223
224
  - test/unit/hostgroup_ansible_role_test.rb