foreman_netbox 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/app/contracts/foreman_netbox/device_contract.rb +3 -3
  4. data/app/contracts/foreman_netbox/params/interface_params.rb +6 -8
  5. data/app/contracts/foreman_netbox/params/ip_address_params.rb +5 -7
  6. data/app/contracts/foreman_netbox/params/tenant_params.rb +4 -6
  7. data/app/contracts/foreman_netbox/virtual_machine_contract.rb +3 -3
  8. data/app/interactors/foreman_netbox/delete_host/organizer.rb +1 -1
  9. data/app/interactors/foreman_netbox/sync_host/organizer.rb +1 -1
  10. data/app/interactors/foreman_netbox/sync_host/sync_device/find.rb +0 -2
  11. data/app/interactors/foreman_netbox/sync_host/sync_device/organizer.rb +10 -10
  12. data/app/interactors/foreman_netbox/sync_host/sync_device/save_netbox_url.rb +1 -1
  13. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/organizer.rb +1 -1
  14. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/organizer.rb +3 -3
  15. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/find.rb +2 -3
  16. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/organizer.rb +1 -1
  17. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/find.rb +1 -1
  18. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/organizer.rb +4 -4
  19. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/delete.rb +3 -1
  20. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/find.rb +1 -1
  21. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/organizer.rb +3 -3
  22. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/update.rb +3 -1
  23. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_site/organizer.rb +2 -2
  24. data/app/interactors/foreman_netbox/sync_host/sync_device/update.rb +2 -0
  25. data/app/interactors/foreman_netbox/sync_host/sync_tags/organizer.rb +2 -2
  26. data/app/interactors/foreman_netbox/sync_host/sync_tenant/organizer.rb +2 -2
  27. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/find.rb +0 -2
  28. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/organizer.rb +8 -8
  29. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/save_netbox_url.rb +1 -1
  30. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/organizer.rb +3 -3
  31. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/sync_cluster_type/organizer.rb +1 -1
  32. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/find.rb +1 -1
  33. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/organizer.rb +4 -4
  34. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/delete.rb +3 -1
  35. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/find.rb +1 -1
  36. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/organizer.rb +3 -3
  37. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/update.rb +3 -1
  38. data/app/lib/foreman_netbox/api.rb +2 -2
  39. data/app/models/orchestration/netbox.rb +3 -5
  40. data/app/services/foreman_netbox/cached_netbox_parameters.rb +11 -11
  41. data/app/services/foreman_netbox/netbox_parameters.rb +27 -27
  42. data/app/services/foreman_netbox/netbox_parameters_comparator.rb +12 -6
  43. data/db/migrate/20230303095650_fix_netbox_settings_category_to_dsl.rb +9 -0
  44. data/lib/foreman_netbox/engine.rb +32 -15
  45. data/lib/foreman_netbox/version.rb +1 -1
  46. data/lib/tasks/foreman_netbox_tasks.rake +0 -2
  47. data/test/integration/foreman_netbox/sync_k8s_physical_host_test.rb +7 -7
  48. data/test/integration/foreman_netbox/sync_rhel_physical_host_test.rb +7 -7
  49. data/test/integration/foreman_netbox/sync_rhel_virtual_host_test.rb +8 -8
  50. data/test/interactors/foreman_netbox/sync_host/organizer_test.rb +13 -13
  51. data/test/interactors/foreman_netbox/sync_host/sync_device/create_test.rb +1 -1
  52. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/create_test.rb +1 -1
  53. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/find_test.rb +4 -4
  54. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/create_test.rb +1 -1
  55. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/find_test.rb +4 -4
  56. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/create_test.rb +1 -1
  57. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/find_test.rb +6 -6
  58. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/update_test.rb +1 -1
  59. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/create_test.rb +3 -3
  60. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/delete_test.rb +1 -1
  61. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/find_test.rb +4 -4
  62. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/create_test.rb +5 -5
  63. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/delete_test.rb +5 -5
  64. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/find_test.rb +3 -3
  65. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/update_test.rb +4 -4
  66. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/update_test.rb +8 -8
  67. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_site/create_test.rb +1 -1
  68. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_site/find_test.rb +3 -3
  69. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_site/update_test.rb +1 -1
  70. data/test/interactors/foreman_netbox/sync_host/sync_device/update_test.rb +38 -8
  71. data/test/interactors/foreman_netbox/sync_host/sync_tenant/create_test.rb +1 -1
  72. data/test/interactors/foreman_netbox/sync_host/sync_tenant/find_test.rb +3 -3
  73. data/test/interactors/foreman_netbox/sync_host/sync_tenant/update_test.rb +1 -1
  74. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/create_test.rb +2 -2
  75. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/create_test.rb +1 -1
  76. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/find_test.rb +2 -2
  77. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/sync_cluster_type/find_test.rb +4 -4
  78. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/update_test.rb +1 -1
  79. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/create_test.rb +3 -3
  80. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/delete_test.rb +1 -1
  81. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/find_test.rb +4 -4
  82. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/create_test.rb +5 -5
  83. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/delete_test.rb +5 -5
  84. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/find_test.rb +3 -3
  85. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/update_test.rb +6 -6
  86. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/update_test.rb +8 -8
  87. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/update_test.rb +8 -8
  88. data/test/models/foreman_netbox/netbox_facet_test.rb +1 -1
  89. data/test/models/foreman_netbox/nics/base_test.rb +1 -1
  90. data/test/services/foreman_netbox/netbox_attributes_test.rb +16 -16
  91. data/test/services/foreman_netbox/netbox_parameters_comparator_test.rb +31 -31
  92. data/test/test_plugin_helper.rb +4 -9
  93. metadata +75 -117
  94. data/app/models/setting/netbox.rb +0 -32
@@ -17,13 +17,13 @@ class UpdateVirtualMachineIpAddressesTest < ActiveSupport::TestCase
17
17
  {
18
18
  id: 1,
19
19
  address: host.netbox_facet.netbox_params[:ip_addresses].first[:address],
20
- tags: default_tags.map { |t| { id: t.id, name: t.name, slug: t.slug } }
20
+ tags: default_tags.map { |t| { id: t.id, name: t.name, slug: t.slug } },
21
21
  },
22
22
  {
23
23
  id: 2,
24
24
  address: host.netbox_facet.netbox_params[:ip_addresses].second[:address],
25
- tags: []
26
- }
25
+ tags: [],
26
+ },
27
27
  ]
28
28
  end
29
29
  let(:host) do
@@ -37,7 +37,7 @@ class UpdateVirtualMachineIpAddressesTest < ActiveSupport::TestCase
37
37
  ip6: '1600:0:2d0:202::17',
38
38
  subnet: FactoryBot.build_stubbed(:subnet_ipv4, organizations: [], locations: []),
39
39
  subnet6: FactoryBot.build_stubbed(:subnet_ipv6, organizations: [], locations: [])
40
- )
40
+ ),
41
41
  ]
42
42
  )
43
43
  end
@@ -50,7 +50,7 @@ class UpdateVirtualMachineIpAddressesTest < ActiveSupport::TestCase
50
50
  status: 200, headers: { 'Content-Type': 'application/json' },
51
51
  body: {
52
52
  count: ip_addresses_data.count,
53
- results: ip_addresses_data
53
+ results: ip_addresses_data,
54
54
  }.to_json
55
55
  )
56
56
  end
@@ -59,7 +59,7 @@ class UpdateVirtualMachineIpAddressesTest < ActiveSupport::TestCase
59
59
  stub_unexpected_patch = stub_request(:patch, "#{Setting[:netbox_url]}/api/ipam/ip-addresses/#{ip_addresses_data.first[:id]}.json")
60
60
  stub_expected_patch = stub_request(:patch, "#{Setting[:netbox_url]}/api/ipam/ip-addresses/#{ip_addresses_data.second[:id]}.json").with(
61
61
  body: {
62
- tags: default_tags.map(&:id)
62
+ tags: default_tags.map(&:id),
63
63
  }.to_json
64
64
  ).to_return(
65
65
  status: 200, headers: { 'Content-Type': 'application/json' },
@@ -18,7 +18,7 @@ class UpdateVirtualMachineInterfacesTest < ActiveSupport::TestCase
18
18
  FactoryBot.build_stubbed(
19
19
  :host,
20
20
  interfaces: [
21
- FactoryBot.build_stubbed(:nic_base, mac: old_mac)
21
+ FactoryBot.build_stubbed(:nic_base, mac: old_mac),
22
22
  ]
23
23
  )
24
24
  end
@@ -42,15 +42,15 @@ class UpdateVirtualMachineInterfacesTest < ActiveSupport::TestCase
42
42
  id: 1,
43
43
  name: host.interfaces.first.netbox_name,
44
44
  mac_address: new_mac,
45
- tags: []
46
- }
47
- ]
45
+ tags: [],
46
+ },
47
+ ],
48
48
  }.to_json
49
49
  )
50
50
  stub_patch = stub_request(:patch, "#{Setting[:netbox_url]}/api/virtualization/interfaces/1.json").with(
51
51
  body: {
52
52
  mac_address: host.interfaces.first.mac.upcase,
53
- tags: default_tags.map(&:id)
53
+ tags: default_tags.map(&:id),
54
54
  }.to_json
55
55
  ).to_return(
56
56
  status: 200, headers: { 'Content-Type': 'application/json' },
@@ -78,9 +78,9 @@ class UpdateVirtualMachineInterfacesTest < ActiveSupport::TestCase
78
78
  mac_address: old_mac,
79
79
  tags: default_tags.map do |tag|
80
80
  { id: tag.id }
81
- end
82
- }
83
- ]
81
+ end,
82
+ },
83
+ ],
84
84
  }.to_json
85
85
  )
86
86
  stub_patch = stub_request(:patch, "#{Setting[:netbox_url]}/api/virtualization/interfaces/1.json")
@@ -30,14 +30,14 @@ class UpdateVirtualMachineTest < ActiveSupport::TestCase
30
30
  'primary_ip4' => {
31
31
  'id' => 1,
32
32
  'family' => 4,
33
- 'address' => '10.0.0.1/24'
33
+ 'address' => '10.0.0.1/24',
34
34
  },
35
35
  'primary_ip6' => {
36
36
  'id' => 2,
37
37
  'family' => 6,
38
- 'address' => '1600:0:2d0:201::18/64'
38
+ 'address' => '1600:0:2d0:201::18/64',
39
39
  },
40
- 'tags' => virtual_machine_tags
40
+ 'tags' => virtual_machine_tags,
41
41
  }
42
42
  )
43
43
  end
@@ -78,7 +78,7 @@ class UpdateVirtualMachineTest < ActiveSupport::TestCase
78
78
  cpus: virtual_machine_data[:vcpus],
79
79
  memory_mb: virtual_machine_data[:memory],
80
80
  volumes: [
81
- OpenStruct.new(size_gb: virtual_machine_data[:disk])
81
+ OpenStruct.new(size_gb: virtual_machine_data[:disk]),
82
82
  ]
83
83
  )
84
84
  )
@@ -95,8 +95,8 @@ class UpdateVirtualMachineTest < ActiveSupport::TestCase
95
95
  count: 2,
96
96
  results: [
97
97
  { id: primary_ip4.id, address: primary_ip4.address.address },
98
- { id: primary_ip6.id, address: primary_ip6.address.address }
99
- ]
98
+ { id: primary_ip6.id, address: primary_ip6.address.address },
99
+ ],
100
100
  }.to_json
101
101
  )
102
102
  end
@@ -142,7 +142,7 @@ class UpdateVirtualMachineTest < ActiveSupport::TestCase
142
142
  cpus: 4,
143
143
  memory_mb: 256,
144
144
  volumes: [
145
- OpenStruct.new(size_gb: 1024)
145
+ OpenStruct.new(size_gb: 1024),
146
146
  ]
147
147
  )
148
148
  )
@@ -160,7 +160,7 @@ class UpdateVirtualMachineTest < ActiveSupport::TestCase
160
160
  primary_ip6: primary_ip6.id,
161
161
  tenant: tenant.id,
162
162
  vcpus: host.compute_object.cpus,
163
- tags: virtual_machine_tags.map { |t| t['id'] } | default_tags.map(&:id)
163
+ tags: virtual_machine_tags.map { |t| t['id'] } | default_tags.map(&:id),
164
164
  }.to_json
165
165
  ).to_return(
166
166
  status: 200, headers: { 'Content-Type': 'application/json' },
@@ -152,7 +152,7 @@ module ForemanNetbox
152
152
  memory_mb: memory,
153
153
  volumes: [
154
154
  OpenStruct.new(size_gb: disk / 2),
155
- OpenStruct.new(size_gb: disk / 2)
155
+ OpenStruct.new(size_gb: disk / 2),
156
156
  ]
157
157
  )
158
158
  )
@@ -73,7 +73,7 @@ module ForemanNetbox
73
73
  context 'without ip and ip6' do
74
74
  let(:nic) { FactoryBot.build_stubbed(:nic_base) }
75
75
 
76
- it { assert_equal [], nic.netbox_ips }
76
+ it { assert_empty nic.netbox_ips }
77
77
  end
78
78
  end
79
79
  end
@@ -16,7 +16,7 @@ module ForemanNetbox
16
16
  let(:expected) do
17
17
  {
18
18
  name: 'Tenant Name',
19
- slug: 'tenant-name'
19
+ slug: 'tenant-name',
20
20
  }
21
21
  end
22
22
 
@@ -33,7 +33,7 @@ module ForemanNetbox
33
33
  let(:expected) do
34
34
  {
35
35
  name: 'device_name',
36
- serial: 'abc123'
36
+ serial: 'abc123',
37
37
  }
38
38
  end
39
39
 
@@ -62,7 +62,7 @@ module ForemanNetbox
62
62
  let(:expected) do
63
63
  {
64
64
  model: 'Product Name',
65
- slug: 'product-name'
65
+ slug: 'product-name',
66
66
  }
67
67
  end
68
68
 
@@ -74,7 +74,7 @@ module ForemanNetbox
74
74
  let(:expected) do
75
75
  {
76
76
  model: 'Unknown',
77
- slug: 'unknown'
77
+ slug: 'unknown',
78
78
  }
79
79
  end
80
80
 
@@ -120,7 +120,7 @@ module ForemanNetbox
120
120
  let(:expected) do
121
121
  {
122
122
  name: 'Site Name',
123
- slug: 'site-name'
123
+ slug: 'site-name',
124
124
  }
125
125
  end
126
126
 
@@ -137,7 +137,7 @@ module ForemanNetbox
137
137
  :nic_base,
138
138
  identifier: expected.first[:name],
139
139
  mac: expected.first[:mac_address]
140
- )
140
+ ),
141
141
  ]
142
142
  )
143
143
  end
@@ -147,8 +147,8 @@ module ForemanNetbox
147
147
  name: 'eth1',
148
148
  mac_address: 'FE:13:C6:44:29:24',
149
149
  type: {
150
- value: 'virtual'
151
- }
150
+ value: 'virtual',
151
+ },
152
152
  ]
153
153
  end
154
154
 
@@ -178,7 +178,7 @@ module ForemanNetbox
178
178
  :subnet_ipv6,
179
179
  cidr: expected.second[:address].split('/').second
180
180
  )
181
- )
181
+ ),
182
182
  ]
183
183
  )
184
184
  end
@@ -188,15 +188,15 @@ module ForemanNetbox
188
188
  {
189
189
  address: '10.0.0.1/24',
190
190
  interface: {
191
- name: 'eth1'
192
- }
191
+ name: 'eth1',
192
+ },
193
193
  },
194
194
  {
195
195
  address: '1500:0:2d0:201::1/64',
196
196
  interface: {
197
- name: 'eth2'
198
- }
199
- }
197
+ name: 'eth2',
198
+ },
199
+ },
200
200
  ]
201
201
  end
202
202
 
@@ -213,7 +213,7 @@ module ForemanNetbox
213
213
  memory_mb: expected[:memory],
214
214
  volumes: [
215
215
  OpenStruct.new(size_gb: expected[:disk] / 2),
216
- OpenStruct.new(size_gb: expected[:disk] / 2)
216
+ OpenStruct.new(size_gb: expected[:disk] / 2),
217
217
  ]
218
218
  )
219
219
  )
@@ -225,7 +225,7 @@ module ForemanNetbox
225
225
  name: 'virtual_machine_name',
226
226
  vcpus: 2,
227
227
  memory: 128,
228
- disk: 20
228
+ disk: 20,
229
229
  }
230
230
  end
231
231
 
@@ -10,8 +10,8 @@ module ForemanNetbox
10
10
  let(:my_hash) do
11
11
  {
12
12
  device: {
13
- name: 'My device'
14
- }
13
+ name: 'My device',
14
+ },
15
15
  }
16
16
  end
17
17
  let(:old_hash) { my_hash }
@@ -25,82 +25,82 @@ module ForemanNetbox
25
25
  let(:old_hash) do
26
26
  {
27
27
  device: {
28
- name: 'Old name'
28
+ name: 'Old name',
29
29
  },
30
30
  device_role: {
31
- name: 'SERVER'
31
+ name: 'SERVER',
32
32
  },
33
33
  manufacturer: {
34
- name: 'Manufacturer'
34
+ name: 'Manufacturer',
35
35
  },
36
36
  interfaces: [
37
37
  {
38
38
  name: 'eth0',
39
39
  type: {
40
- value: 'virtual'
41
- }
40
+ value: 'virtual',
41
+ },
42
42
  },
43
43
  {
44
44
  name: 'eth1',
45
45
  type: {
46
- value: 'virtual'
47
- }
46
+ value: 'virtual',
47
+ },
48
48
  },
49
49
  {
50
50
  name: 'eth2',
51
51
  type: {
52
- value: 'virtual'
53
- }
52
+ value: 'virtual',
53
+ },
54
54
  },
55
55
  {
56
56
  name: 'eth4',
57
57
  mac_address: '00:50:56:84:6D:84',
58
58
  type: {
59
- value: 'virtual'
60
- }
61
- }
62
- ]
59
+ value: 'virtual',
60
+ },
61
+ },
62
+ ],
63
63
  }
64
64
  end
65
65
 
66
66
  let(:new_hash) do
67
67
  {
68
68
  device: {
69
- name: 'New name'
69
+ name: 'New name',
70
70
  },
71
71
  device_type: {
72
- model: 'Model name'
72
+ model: 'Model name',
73
73
  },
74
74
  manufacturer: {
75
- name: 'Manufacturer'
75
+ name: 'Manufacturer',
76
76
  },
77
77
  interfaces: [
78
78
  {
79
79
  name: 'eth0',
80
80
  type: {
81
- value: 'virtual'
82
- }
81
+ value: 'virtual',
82
+ },
83
83
  },
84
84
  {
85
85
  name: 'eth1',
86
86
  type: {
87
- value: 'new_type'
88
- }
87
+ value: 'new_type',
88
+ },
89
89
  },
90
90
  {
91
91
  name: 'eth3',
92
92
  type: {
93
- value: 'virtual'
94
- }
93
+ value: 'virtual',
94
+ },
95
95
  },
96
96
  {
97
97
  name: 'eth4',
98
98
  mac_address: '00:50:56:84:6D:84',
99
99
  type: {
100
- value: 'virtual'
101
- }
102
- }
103
- ]
100
+ value: 'virtual',
101
+ },
102
+ },
103
+ ],
104
104
  }
105
105
  end
106
106
 
@@ -111,12 +111,12 @@ module ForemanNetbox
111
111
  device: {
112
112
  name: {
113
113
  old: old_hash.dig(:device, :name), new: new_hash.dig(:device, :name)
114
- }
114
+ },
115
115
  },
116
116
  interfaces: {
117
117
  added: new_hash[:interfaces].select { |i| %w[eth1 eth3].include?(i[:name]) },
118
- removed: old_hash[:interfaces].select { |i| %w[eth1 eth2].include?(i[:name]) }
119
- }
118
+ removed: old_hash[:interfaces].select { |i| %w[eth1 eth2].include?(i[:name]) },
119
+ },
120
120
  }
121
121
  end
122
122
 
@@ -10,15 +10,10 @@ FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories
10
10
  FactoryBot.reload
11
11
 
12
12
  def setup_default_netbox_settings(netbox_url: 'https://netbox.example.com', netbox_api_token: 'api_key')
13
- if Gem::Version.new(SETTINGS[:version].notag) < Gem::Version.new('2.6')
14
- FactoryBot.create(:setting, name: 'netbox_url', value: netbox_url, category: 'Setting::Netbox')
15
- FactoryBot.create(:setting, name: 'netbox_api_token', value: netbox_api_token, category: 'Setting::Netbox')
16
- FactoryBot.create(:setting, name: 'netbox_orchestration_enabled', value: true, category: 'Setting::Netbox')
17
- else
18
- Setting[:netbox_url] = netbox_url
19
- Setting[:netbox_api_token] = netbox_api_token
20
- Setting[:netbox_orchestration_enabled] = true
21
- end
13
+ Setting[:netbox_url] = netbox_url
14
+ Setting[:netbox_api_token] = netbox_api_token
15
+ Setting[:netbox_orchestration_enabled] = true
16
+ Setting[:netbox_skip_site_update] = false
22
17
  end
23
18
 
24
19
  def setup_netbox_integration_test