foreman_inventory_upload 2.0.3 → 2.0.4.pre.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df8943022dd75fcce3aadedde8db465bc7bfd3fd4f0d760a9c149e9d0e43446b
|
4
|
+
data.tar.gz: d5492c0003b1b27a619596569c5965e8850388b0cbd6e64400136d38e8acc856
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58ed0e5819993091a3eef055b352243a13069d904f3b09d275107bab1c1537f57ac3e78f86ec60b72b9d3f3d7be5c2cd2eb871b46df861d68b85b6c0282f96b1
|
7
|
+
data.tar.gz: 1d6a234e673067962e5163e4ddca2315f4e904a91ced1c0ca3dc6aa393c35cac66b325d8bf98d67e0e7a46d4ec2f1b22d49dd0f38190f239aaa507833248b2c5
|
@@ -52,7 +52,7 @@ module ForemanInventoryUpload
|
|
52
52
|
@stream.object_field('system_profile') do
|
53
53
|
report_system_profile(host)
|
54
54
|
end
|
55
|
-
@stream.array_field('facts'
|
55
|
+
@stream.array_field('facts') do
|
56
56
|
@stream.object do
|
57
57
|
@stream.simple_field('namespace', 'satellite')
|
58
58
|
@stream.object_field('facts', :last) do
|
@@ -60,7 +60,21 @@ module ForemanInventoryUpload
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
@stream.array_field('tags', :last) do
|
65
|
+
report_tag('satellite', 'satellite_instance_id', Foreman.instance_id) if Foreman.respond_to?(:instance_id)
|
66
|
+
report_tag('satellite', 'organization_id', host.organization_id, :last)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def report_tag(namespace, key, value, last = nil)
|
72
|
+
@stream.object do
|
73
|
+
@stream.simple_field('namespace', namespace)
|
74
|
+
@stream.simple_field('key', key)
|
75
|
+
@stream.simple_field('value', value, :last)
|
63
76
|
end
|
77
|
+
@stream.comma unless last
|
64
78
|
end
|
65
79
|
|
66
80
|
def report_system_profile(host)
|
data/package.json
CHANGED
@@ -26,13 +26,12 @@
|
|
26
26
|
"devDependencies": {
|
27
27
|
"@babel/core": "^7.7.0",
|
28
28
|
"@theforeman/builder": "^4.0.2",
|
29
|
-
"@theforeman/eslint-plugin-foreman": "^4.0.2",
|
30
29
|
"@theforeman/stories": "^4.0.2",
|
31
30
|
"@theforeman/test": "^4.0.2",
|
32
31
|
"@theforeman/vendor-dev": "^4.0.2",
|
32
|
+
"@theforeman/eslint-plugin-foreman": "^4.0.2",
|
33
33
|
"babel-eslint": "^10.0.0",
|
34
|
-
"eslint": "^6.
|
35
|
-
"jed": "^1.1.1",
|
34
|
+
"eslint": "^6.7.2",
|
36
35
|
"prettier": "^1.13.5",
|
37
36
|
"raf": "^3.4.0",
|
38
37
|
"stylelint": "^9.3.0",
|
@@ -40,6 +39,7 @@
|
|
40
39
|
"surge": "^0.20.3"
|
41
40
|
},
|
42
41
|
"dependencies": {
|
42
|
+
"jed": "^1.1.1",
|
43
43
|
"react-intl": "^2.8.0"
|
44
44
|
}
|
45
45
|
}
|
@@ -59,7 +59,7 @@ class ReportGeneratorTest < ActiveSupport::TestCase
|
|
59
59
|
end
|
60
60
|
|
61
61
|
test 'generates a report with satellite facts' do
|
62
|
-
Foreman.expects(:instance_id).returns('satellite-id')
|
62
|
+
Foreman.expects(:instance_id).twice.returns('satellite-id')
|
63
63
|
batch = Host.where(id: @host.id).in_batches.first
|
64
64
|
generator = ForemanInventoryUpload::Generators::Slice.new(batch, [], 'slice-123')
|
65
65
|
|
@@ -72,6 +72,14 @@ class ReportGeneratorTest < ActiveSupport::TestCase
|
|
72
72
|
assert_equal 'satellite-id', satellite_facts['satellite_instance_id']
|
73
73
|
assert_equal @host.organization_id, satellite_facts['organization_id']
|
74
74
|
|
75
|
+
instance_id_tag = actual['hosts'].first['tags'].find { |tag| tag['namespace'] == 'satellite' && tag['key'] == 'satellite_instance_id'}
|
76
|
+
assert_not_nil instance_id_tag
|
77
|
+
assert_equal 'satellite-id', instance_id_tag['value']
|
78
|
+
|
79
|
+
org_id_tag = actual['hosts'].first['tags'].find { |tag| tag['namespace'] == 'satellite' && tag['key'] == 'organization_id'}
|
80
|
+
assert_not_nil org_id_tag
|
81
|
+
assert_equal @host.organization_id, org_id_tag['value']
|
82
|
+
|
75
83
|
version = satellite_facts['satellite_version']
|
76
84
|
if defined?(ForemanThemeSatellite)
|
77
85
|
assert_equal ForemanThemeSatellite::SATELLITE_VERSION, version
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_inventory_upload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inventory upload team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -318,21 +318,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
318
318
|
version: '0'
|
319
319
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
320
320
|
requirements:
|
321
|
-
- - "
|
321
|
+
- - ">"
|
322
322
|
- !ruby/object:Gem::Version
|
323
|
-
version:
|
323
|
+
version: 1.3.1
|
324
324
|
requirements: []
|
325
325
|
rubygems_version: 3.0.6
|
326
326
|
signing_key:
|
327
327
|
specification_version: 4
|
328
328
|
summary: Summary of ForemanInventoryUpload.
|
329
329
|
test_files:
|
330
|
-
- test/
|
330
|
+
- test/test_plugin_helper.rb
|
331
|
+
- test/factories/inventory_upload_factories.rb
|
331
332
|
- test/controllers/reports_controller_test.rb
|
332
333
|
- test/controllers/uploads_controller_test.rb
|
333
|
-
- test/
|
334
|
-
- test/
|
335
|
-
- test/unit/archived_report_generator_test.rb
|
334
|
+
- test/controllers/accounts_controller_test.rb
|
335
|
+
- test/unit/slice_generator_test.rb
|
336
336
|
- test/unit/metadata_generator_test.rb
|
337
337
|
- test/unit/shell_process_job_test.rb
|
338
|
-
- test/unit/
|
338
|
+
- test/unit/archived_report_generator_test.rb
|