foreman_datacenter 1.16.11 → 1.16.12

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: d6a6f4a885e75a5d8a297f7b93c05dcb07d270417bee25419af696a6aabcec96
4
- data.tar.gz: 05f7264a4bc4fd47b023c2a1c21d7caca2cfb503a0be38738fa97a82293636c7
3
+ metadata.gz: a2b19a8ebbbfd9fb0447561147ffd64227a91b5ff08121c1fc0b56a06a3f5ee9
4
+ data.tar.gz: c3c6679a50f928e0895001f709f6e317479a51711b682cb60029f0ae4ae031cd
5
5
  SHA512:
6
- metadata.gz: 12915cc416ba0794b80a85c54e8f80cd054c4dc9aa7bdf9c09f1c561f166fd0c8944fee769d86efa8520f5ee20db9ba3381935cf278432ff1e43d467de737961
7
- data.tar.gz: fe521e92a864944e89ca59baaa54c73a87d9985b3d72a7b53e1a43069f04ed37b9edbfbc3cb88a10b1393b5afc813d1bb6f977f8f594dc25ca16d2010fcf5a3c
6
+ metadata.gz: 2372432d548604b47861fddf088d865cedc6da89fe7e3fc1557f9d6fdf0a1a8e2705fcc602f76b071f64ffcc31427294db57db84461ab514ac0519ba838b628a
7
+ data.tar.gz: 0dbc2c1db3a3dc564cf62d49c200194cbbd7c6934c3ce9379ce098bc8ece36d54105f897feddf845b69b861800efe3eae543ceb8867695df6de69b2bfde095e4
@@ -72,14 +72,12 @@ module ForemanDatacenter
72
72
  console_server_port,
73
73
  params[:console_port][:connection_status]
74
74
  )
75
- redirect_to device_url(id: @console_port.device_id),
76
- notice: 'Console port was successfully connected.'
75
+ process_success(success_msg: "Console port was successfully connected.", success_redirect: device_url(id: @console_port.device_id))
77
76
  end
78
77
 
79
78
  def disconnect
80
79
  @console_port.disconnect
81
- redirect_to device_url(id: @console_port.device_id),
82
- notice: 'Console port was successfully disconnected.'
80
+ process_success(success_msg: "Console port was successfully disconnected.", success_redirect: device_url(id: @console_port.device_id))
83
81
  end
84
82
  end
85
83
  end
@@ -18,8 +18,7 @@ module ForemanDatacenter
18
18
  @console_server_port = ForemanDatacenter::ConsoleServerPort.new(console_server_port_params.merge(device_id: params[:device_id]))
19
19
 
20
20
  if @console_server_port.save
21
- redirect_to device_url(id: @console_server_port.device_id),
22
- notice: 'Console server port was successfully created.'
21
+ process_success(success_msg: "Console server port was successfully created.", success_redirect: device_url(id: @console_server_port.device_id))
23
22
  else
24
23
  process_error object: @console_server_port
25
24
  end
@@ -27,8 +26,7 @@ module ForemanDatacenter
27
26
 
28
27
  def update
29
28
  if @console_server_port.update(console_server_port_params)
30
- redirect_to device_url(id: @console_server_port.device_id),
31
- notice: 'Console server port was successfully updated.'
29
+ process_success(success_msg: "Console server port was successfully updated.", success_redirect: device_url(id: @console_server_port.device_id))
32
30
  else
33
31
  process_error object: @console_server_port
34
32
  end
@@ -36,8 +34,7 @@ module ForemanDatacenter
36
34
 
37
35
  def destroy
38
36
  if @console_server_port.destroy
39
- redirect_to device_url(id: @console_server_port.device_id),
40
- notice: 'Console server port was successfully destroyed.'
37
+ process_success(success_msg: "Console server port was successfully destroyed.", success_redirect: device_url(id: @console_server_port.device_id))
41
38
  else
42
39
  process_error object: @console_server_port
43
40
  end
@@ -52,14 +49,12 @@ module ForemanDatacenter
52
49
  @console_server_port,
53
50
  params[:console_port][:connection_status]
54
51
  )
55
- redirect_to device_url(id: @console_server_port.device_id),
56
- notice: 'Console server port was successfully connected.'
52
+ process_success(success_msg: "Console server port was successfully connected.", success_redirect: device_url(id: @console_server_port.device_id))
57
53
  end
58
54
 
59
55
  def disconnect
60
56
  @console_server_port.console_port.disconnect
61
- redirect_to device_url(id: @console_server_port.device_id),
62
- notice: 'Console server port was successfully disconnected.'
57
+ process_success(success_msg: "Console server port was successfully disconnected.", success_redirect: device_url(id: @console_server_port.device_id))
63
58
  end
64
59
 
65
60
  def for_device
@@ -17,8 +17,7 @@ module ForemanDatacenter
17
17
  @device_bay = ForemanDatacenter::DeviceBay.new(device_bay_params.merge(device_id: params[:device_id]))
18
18
 
19
19
  if @device_bay.save
20
- redirect_to device_url(@device_bay.device),
21
- notice: 'New device bay was successfully created'
20
+ process_success(success_msg: "New device bay was successfully created.", success_redirect: device_url(id: @device_bay.device))
22
21
  else
23
22
  process_error object: @device_bay
24
23
  end
@@ -26,8 +25,7 @@ module ForemanDatacenter
26
25
 
27
26
  def update
28
27
  if @device_bay.update(device_bay_params)
29
- redirect_to device_url(@device_bay.device),
30
- notice: 'Device bay was successfully updated'
28
+ process_success(success_msg: "Device bay was successfully updated.", success_redirect: device_url(id: @device_bay.device))
31
29
  else
32
30
  process_error object: @device_bay
33
31
  end
@@ -35,8 +33,7 @@ module ForemanDatacenter
35
33
 
36
34
  def destroy
37
35
  if @device_bay.destroy
38
- redirect_to device_url(@device_bay.device),
39
- notice: 'Device bay was successfully destroyed'
36
+ process_success(success_msg: "Device bay was successfully destroyed.", success_redirect: device_url(id: @device_bay.device))
40
37
  else
41
38
  process_error object: @device_bay
42
39
  end
@@ -48,8 +45,7 @@ module ForemanDatacenter
48
45
  def populate
49
46
  device_id = params[:device_bay][:installed_device_id]
50
47
  if @device_bay.update(installed_device_id: device_id)
51
- redirect_to device_url(@device_bay.device),
52
- notice: 'Device bay was successfully populated'
48
+ process_success(success_msg: "Device bay was successfully populated.", success_redirect: device_url(id: @device_bay.device))
53
49
  else
54
50
  process_error object: @device_bay
55
51
  end
@@ -57,8 +53,7 @@ module ForemanDatacenter
57
53
 
58
54
  def depopulate
59
55
  if @device_bay.update(installed_device_id: nil)
60
- redirect_to device_url(@device_bay.device),
61
- notice: 'Device bay was successfully depopulated'
56
+ process_success(success_msg: "Device bay was successfully depopulated.", success_redirect: device_url(id: @device_bay.device))
62
57
  else
63
58
  process_error object: @device_bay
64
59
  end
@@ -24,8 +24,7 @@ module ForemanDatacenter
24
24
  @device_interface_connection.first_interface = get_device_interface
25
25
 
26
26
  if @device_interface_connection.save
27
- redirect_to device_url(@device_interface_connection.first_interface.device),
28
- notice: 'Connection was successfully created.'
27
+ process_success(success_msg: "Connection was successfully created.", success_redirect: device_url(id: @device_interface_connection.first_interface.device))
29
28
  else
30
29
  process_error object: @device_interface_connection
31
30
  end
@@ -56,9 +55,5 @@ module ForemanDatacenter
56
55
  def get_device_interface
57
56
  ForemanDatacenter::DeviceInterface.find(params[:device_interface_id])
58
57
  end
59
-
60
- def device_interface_connection_params
61
- params[:foreman_datacenter_device_interface_connetction].permit(:speed)
62
- end
63
58
  end
64
59
  end
@@ -28,8 +28,7 @@ module ForemanDatacenter
28
28
  @device_interface = ForemanDatacenter::DeviceInterface.new(device_interface_params.merge(device_id: params[:device_id]))
29
29
 
30
30
  if @device_interface.save
31
- redirect_to device_url(id: @device_interface.device_id),
32
- notice: 'Device interface was successfully created.'
31
+ process_success(success_msg: "Device interface was successfully created.", success_redirect: device_url(id: @device_interface.device.id))
33
32
  else
34
33
  process_error object: @device_interface
35
34
  end
@@ -37,8 +36,7 @@ module ForemanDatacenter
37
36
 
38
37
  def update
39
38
  if @device_interface.update(device_interface_params)
40
- redirect_to device_url(id: @device_interface.device_id),
41
- notice: 'Device interface was successfully updated.'
39
+ process_success(success_msg: "Device interface was successfully updated.", success_redirect: device_url(id: @device_interface.device.id))
42
40
  else
43
41
  process_error object: @device_interface
44
42
  end
@@ -46,8 +44,7 @@ module ForemanDatacenter
46
44
 
47
45
  def destroy
48
46
  if @device_interface.destroy
49
- redirect_to device_url(id: @device_interface.device_id),
50
- notice: 'Device interface was successfully destroyed.'
47
+ process_success(success_msg: "Device interface was successfully destroyed.", success_redirect: device_url(id: @device_interface.device.id))
51
48
  else
52
49
  process_error object: @device_interface
53
50
  end
@@ -15,10 +15,8 @@ module ForemanDatacenter
15
15
 
16
16
  def create
17
17
  @device_module = ForemanDatacenter::DeviceModule.new(device_module_params.merge(device_id: params[:device_id]))
18
-
19
18
  if @device_module.save
20
- redirect_to inventory_device_url(id: @device_module.device_id),
21
- notice: 'Device module was successfully created.'
19
+ process_success(success_msg: "Device module was successfully created.", success_redirect: inventory_device_url(id: @device_module.device_id))
22
20
  else
23
21
  process_error object: @device_module
24
22
  end
@@ -26,8 +24,7 @@ module ForemanDatacenter
26
24
 
27
25
  def update
28
26
  if @device_module.update(device_module_params)
29
- redirect_to inventory_device_url(id: @device_module.device_id),
30
- notice: 'Device module was successfully updated.'
27
+ process_success(success_msg: "Device module was successfully updated.", success_redirect: inventory_device_url(id: @device_module.device_id))
31
28
  else
32
29
  process_error object: @device_module
33
30
  end
@@ -35,8 +32,7 @@ module ForemanDatacenter
35
32
 
36
33
  def destroy
37
34
  if @device_module.destroy
38
- redirect_to inventory_device_url(id: @device_module.device_id),
39
- notice: 'Device module was successfully destroyed.'
35
+ process_success(success_msg: "Device module was successfully destroyed.", success_redirect: inventory_device_url(id: @device_module.device_id))
40
36
  else
41
37
  process_error object: @device_module
42
38
  end
@@ -33,8 +33,7 @@ module ForemanDatacenter
33
33
 
34
34
  def update
35
35
  if @device_type.update(device_type_params)
36
- redirect_to device_type_url(@device_type),
37
- notice: 'Device type was successfully updated'
36
+ process_success object: @device_type
38
37
  else
39
38
  process_error object: @device_type
40
39
  end
@@ -96,7 +96,7 @@ module ForemanDatacenter
96
96
  @device.non_management_interfaces.
97
97
  where(id: params[:interfaces]).
98
98
  destroy_all
99
- redirect_to device_url(@device)
99
+ process_success(success_msg: "Selected interfaces were successfully destroyed.", success_redirect: device_url(id: @device))
100
100
  end
101
101
 
102
102
  def qr_code
@@ -107,11 +107,9 @@ module ForemanDatacenter
107
107
 
108
108
  def sync_interfaces_with_host
109
109
  if @device.sync_interfaces_with_host
110
- notice("Device successfully synchronized.")
111
- redirect_to device_url(@device)
110
+ process_success(success_msg: "Device successfully synchronized.", success_redirect: device_url(id: @device))
112
111
  else
113
- error("Unsuccessful synchronization.")
114
- redirect_to device_url(@device)
112
+ process_error(error_msg: "Unsuccessfully synchronization.", redirect: device_url(@device))
115
113
  end
116
114
  end
117
115
 
@@ -140,4 +138,3 @@ module ForemanDatacenter
140
138
  end
141
139
  end
142
140
  end
143
-
@@ -16,8 +16,7 @@ module ForemanDatacenter
16
16
  @management_device = ManagementDevice.new(management_device_params.merge(device_id: params[:device_id]))
17
17
 
18
18
  if @management_device.save
19
- redirect_to device_url(@management_device.device),
20
- notice: 'New management device was successfully created'
19
+ process_success(success_redirect: device_url(id: @management_device.device))
21
20
  else
22
21
  process_error object: @management_device
23
22
  end
@@ -25,8 +24,7 @@ module ForemanDatacenter
25
24
 
26
25
  def update
27
26
  if @management_device.update(management_device_params)
28
- redirect_to device_url(@management_device.device),
29
- notice: 'Management device was successfully updated'
27
+ process_success(success_redirect: device_url(id: @management_device.device))
30
28
  else
31
29
  process_error object: @management_device
32
30
  end
@@ -34,8 +32,7 @@ module ForemanDatacenter
34
32
 
35
33
  def destroy
36
34
  if @management_device.destroy
37
- redirect_to device_url(@management_device.device),
38
- notice: 'Management device was successfully destroyed'
35
+ process_success(success_redirect: device_url(id: @management_device.device))
39
36
  else
40
37
  process_error object: @management_device
41
38
  end
@@ -18,8 +18,7 @@ module ForemanDatacenter
18
18
  @power_outlet = PowerOutlet.new(power_outlet_params.merge(device_id: params[:device_id]))
19
19
 
20
20
  if @power_outlet.save
21
- redirect_to device_url(id: @power_outlet.device_id),
22
- notice: 'Power outlet was successfully created.'
21
+ process_success(success_redirect: device_url(id: @power_outlet.device_id))
23
22
  else
24
23
  process_error object: @power_outlet
25
24
  end
@@ -27,8 +26,7 @@ module ForemanDatacenter
27
26
 
28
27
  def update
29
28
  if @power_outlet.update(power_outlet_params)
30
- redirect_to device_url(id: @power_outlet.device_id),
31
- notice: 'Power outlet was successfully updated.'
29
+ process_success(success_redirect: device_url(id: @power_outlet.device_id))
32
30
  else
33
31
  process_error object: @power_outlet
34
32
  end
@@ -36,8 +34,7 @@ module ForemanDatacenter
36
34
 
37
35
  def destroy
38
36
  if @power_outlet.destroy
39
- redirect_to device_url(id: @power_outlet.device_id),
40
- notice: 'Power outlet was successfully destroyed.'
37
+ process_success(success_redirect: device_url(id: @power_outlet.device_id))
41
38
  else
42
39
  process_error object: @power_outlet
43
40
  end
@@ -52,14 +49,12 @@ module ForemanDatacenter
52
49
  @power_outlet,
53
50
  params[:power_port][:connection_status]
54
51
  )
55
- redirect_to device_url(id: @power_outlet.device_id),
56
- notice: 'Power outlet was successfully connected.'
52
+ process_success(success_msg: "Power outlet was successfully connected.", success_redirect: device_url(id: @power_outlet.device_id))
57
53
  end
58
54
 
59
55
  def disconnect
60
56
  @power_outlet.power_port.disconnect
61
- redirect_to device_url(id: @power_outlet.device_id),
62
- notice: 'Power outlet was successfully disconnected.'
57
+ process_success(success_msg: "Power outlet was successfully disconnected.", success_redirect: device_url(id: @power_outlet.device_id))
63
58
  end
64
59
 
65
60
  def for_device
@@ -24,8 +24,7 @@ module ForemanDatacenter
24
24
  @power_port = ForemanDatacenter::PowerPort.new(power_port_params.merge(device_id: params[:device_id]))
25
25
 
26
26
  if @power_port.save
27
- redirect_to device_url(id: @power_port.device_id),
28
- notice: 'Power port was successfully created.'
27
+ process_success(success_redirect: device_url(id: @power_port.device_id))
29
28
  else
30
29
  process_error object: @power_port
31
30
  end
@@ -33,8 +32,7 @@ module ForemanDatacenter
33
32
 
34
33
  def update
35
34
  if @power_port.update(power_port_params)
36
- redirect_to device_url(id: @power_port.device_id),
37
- notice: 'Power port was successfully updated.'
35
+ process_success(success_redirect: device_url(id: @power_port.device_id))
38
36
  else
39
37
  process_error object: @power_port
40
38
  end
@@ -42,8 +40,7 @@ module ForemanDatacenter
42
40
 
43
41
  def destroy
44
42
  if @power_port.destroy
45
- redirect_to device_url(id: @power_port.device_id),
46
- notice: 'Power port was successfully destroyed.'
43
+ process_success(success_redirect: device_url(id: @power_port.device_id))
47
44
  else
48
45
  process_error object: @power_port
49
46
  end
@@ -73,14 +70,12 @@ module ForemanDatacenter
73
70
  power_outlet,
74
71
  params[:power_port][:connection_status]
75
72
  )
76
- redirect_to device_url(id: @power_port.device_id),
77
- notice: 'Power port was successfully connected.'
73
+ process_success(success_msg: "Power port was successfully connected.", success_redirect: device_url(id: @power_port.device_id))
78
74
  end
79
75
 
80
76
  def disconnect
81
77
  @power_port.disconnect
82
- redirect_to device_url(id: @power_port.device_id),
83
- notice: 'Power port was successfully disconnected.'
78
+ process_success(success_msg: "Power port was successfully disconnected.", success_redirect: device_url(id: @power_port.device_id))
84
79
  end
85
80
  end
86
81
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanDatacenter
2
- VERSION = '1.16.11'.freeze
2
+ VERSION = '1.16.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_datacenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.11
4
+ version: 1.16.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Ivanov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-28 00:00:00.000000000 Z
12
+ date: 2019-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: prawn
@@ -594,7 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
594
594
  - !ruby/object:Gem::Version
595
595
  version: '0'
596
596
  requirements: []
597
- rubygems_version: 3.0.2
597
+ rubygems_version: 3.0.3
598
598
  signing_key:
599
599
  specification_version: 4
600
600
  summary: A plugin that lets you document your servers in a datacenter