@@ -20,28 +20,43 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::Vm < Man
20
20
supports_not :suspend
21
21
22
22
supports :publish do
23
- return _ ( "Publish not supported because VM is blank" ) if blank?
24
- return _ ( "Publish not supported because VM is orphaned" ) if orphaned?
25
- return _ ( "Publish not supported because VM is archived" ) if archived?
23
+ if blank?
24
+ _ ( "Publish not supported because VM is blank" )
25
+ elsif orphaned?
26
+ _ ( "Publish not supported because VM is orphaned" )
27
+ elsif archived?
28
+ _ ( "Publish not supported because VM is archived" )
29
+ end
26
30
end
27
31
28
32
# TODO: converge these all into console and use unsupported_reason(:console) for all
29
33
supports :html5_console do
30
- return _ ( "VM Console not supported because VM is not powered on" ) unless current_state == "on"
31
- return _ ( "VM Console not supported because VM is orphaned" ) if orphaned?
32
- return _ ( "VM Console not supported because VM is archived" ) if archived?
34
+ if current_state != "on"
35
+ _ ( "VM Console not supported because VM is not powered on" )
36
+ elsif orphaned?
37
+ _ ( "VM Console not supported because VM is orphaned" )
38
+ elsif archived?
39
+ _ ( "VM Console not supported because VM is archived" )
40
+ end
33
41
end
34
42
supports :launch_html5_console
35
43
36
44
supports :native_console do
37
- return _ ( "VM Console not supported because VM is orphaned" ) if orphaned?
38
- return _ ( "VM Console not supported because VM is archived" ) if archived?
45
+ if orphaned?
46
+ _ ( "VM Console not supported because VM is orphaned" )
47
+ elsif archived?
48
+ _ ( "VM Console not supported because VM is archived" )
49
+ end
39
50
end
40
51
41
52
supports :resize do
42
- return _ ( 'The VM is not powered off' ) unless current_state == "off"
43
- return _ ( 'The VM is not connected to a provider' ) unless ext_management_system
44
- return _ ( 'SAP VM resize not supported' ) if flavor . kind_of? ( ManageIQ ::Providers ::IbmCloud ::PowerVirtualServers ::CloudManager ::SAPProfile )
53
+ if current_state != "off"
54
+ _ ( 'The VM is not powered off' )
55
+ elsif ext_management_system . nil?
56
+ _ ( 'The VM is not connected to a provider' )
57
+ elsif flavor . kind_of? ( ManageIQ ::Providers ::IbmCloud ::PowerVirtualServers ::CloudManager ::SAPProfile )
58
+ _ ( 'SAP VM resize not supported' )
59
+ end
45
60
end
46
61
47
62
def cloud_instance_id
0 commit comments