foreman_datacenter 1.21.0 → 1.21.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: 64102af224ccc9a02a815ebdbb6356fa625c1d8b76123d59b59b547843520bd9
4
- data.tar.gz: f2db49105428b8fa63de5a47305b67f36d49a9053ebd644476e0a255e0f3a524
3
+ metadata.gz: d71f0d76885d5c5b8a029f7bfc5e80d09cf1531b3337932a51063b6eba8ebdce
4
+ data.tar.gz: e22697f42b15faf0e14c425e24a02f86dc654fb59499bcf4dfcc3546a4c9db85
5
5
  SHA512:
6
- metadata.gz: cff9094b249866f2bbe02e94d4a48ad0c3ddd80be0325b63b7ca073defc912065937887165151dedb14fcea59c0e1912ee63817cc2ca10eab38a63e707636fba
7
- data.tar.gz: df2871ea14eeae46288cd2b377cefc039091aa2707973951689f6276161f29bb39e4a092c389e2579c07b0411cb61c469e6365c27f3a1c647598567719f6abeb
6
+ metadata.gz: 8a7b75fd41acac257387496e0fc8c285d6884899a64347b10e18dddcd4f2832e0861c9c7a726021e6a178da6b6ed11ddf6e3ded6514b86b134b25051be250f72
7
+ data.tar.gz: f97d71ee16669160273a2d5bbb8d554561e6ab83c598d5315d6525b407f0a99e13e6dbb21906f585f6768cfcef4fc6ba5ce098369a224a45248c58d074e8a90f
@@ -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
 
@@ -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.21.0'.freeze
2
+ VERSION = '1.21.1'.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.21.0
4
+ version: 1.21.1
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-30 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