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 +4 -4
- data/app/controllers/foreman_datacenter/console_ports_controller.rb +2 -4
- data/app/controllers/foreman_datacenter/console_server_ports_controller.rb +5 -10
- data/app/controllers/foreman_datacenter/device_bays_controller.rb +5 -10
- data/app/controllers/foreman_datacenter/device_interface_connections_controller.rb +1 -6
- data/app/controllers/foreman_datacenter/device_interfaces_controller.rb +3 -6
- data/app/controllers/foreman_datacenter/device_modules_controller.rb +3 -7
- data/app/controllers/foreman_datacenter/device_types_controller.rb +1 -2
- data/app/controllers/foreman_datacenter/devices_controller.rb +3 -5
- data/app/controllers/foreman_datacenter/management_devices_controller.rb +3 -6
- data/app/controllers/foreman_datacenter/power_outlets_controller.rb +5 -10
- data/app/controllers/foreman_datacenter/power_ports_controller.rb +5 -10
- data/lib/foreman_datacenter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d71f0d76885d5c5b8a029f7bfc5e80d09cf1531b3337932a51063b6eba8ebdce
|
4
|
+
data.tar.gz: e22697f42b15faf0e14c425e24a02f86dc654fb59499bcf4dfcc3546a4c9db85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
111
|
-
redirect_to device_url(@device)
|
110
|
+
process_success(success_msg: "Device successfully synchronized.", success_redirect: device_url(id: @device))
|
112
111
|
else
|
113
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
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.
|
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-
|
12
|
+
date: 2019-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: prawn
|