foreman_rh_cloud 4.0.29 → 4.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ module ForemanInventoryUpload
13
13
  organizations +
14
14
  content_data +
15
15
  satellite_server_data
16
- ).reject { |key, value| value.empty? }
16
+ ).reject { |key, value| value.empty? }.map { |key, value| [key, truncated_value(value)] }
17
17
  end
18
18
 
19
19
  def generate_parameters
@@ -21,6 +21,7 @@ module ForemanInventoryUpload
21
21
 
22
22
  (@host.host_params || {})
23
23
  .select { |_name, value| value.present? || value.is_a?(FalseClass) }
24
+ .map { |key, value| [key, truncated_value(value)] }
24
25
  end
25
26
 
26
27
  private
@@ -57,6 +58,12 @@ module ForemanInventoryUpload
57
58
  ['organization_id', @host.organization_id.to_s],
58
59
  ]
59
60
  end
61
+
62
+ def truncated_value(value)
63
+ return 'Original value exceeds 250 characters' if value.to_s.length > 250
64
+
65
+ value
66
+ end
60
67
  end
61
68
  end
62
69
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '4.0.29'.freeze
2
+ VERSION = '4.0.30'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "4.0.29",
3
+ "version": "4.0.30",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -103,6 +103,21 @@ class TagsGeneratorTest < ActiveSupport::TestCase
103
103
  assert_equal 0, actual.count
104
104
  end
105
105
 
106
+ test 'truncates parameter tags' do
107
+ Setting[:include_parameter_tags] = true
108
+
109
+ @host.stubs(:host_params).returns(
110
+ {
111
+ 'str_param' => 'a' * 251,
112
+ }
113
+ )
114
+
115
+ generator = create_generator
116
+ actual = Hash[generator.generate_parameters]
117
+
118
+ assert_equal 'Original value exceeds 250 characters', actual['str_param']
119
+ end
120
+
106
121
  private
107
122
 
108
123
  def create_generator
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.29
4
+ version: 4.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -174,6 +174,7 @@ files:
174
174
  - app/views/layouts/foreman_rh_cloud/application.html.erb
175
175
  - config/Gemfile.lock.gh_test
176
176
  - config/database.yml.example
177
+ - config/package-lock.json
177
178
  - config/package-lock.json.gh_test
178
179
  - config/package-lock.json.plugin
179
180
  - config/rh_cert-api_chain.pem