Skip to content

Commit d8539c0

Browse files
author
Vincent Febvre
committed
Make provisioning/clone/publish not supported for archived VMs/Templates
Signed-off-by: Vincent Febvre <[email protected]>
1 parent 5e61627 commit d8539c0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

app/models/manageiq/providers/ibm_power_hmc/infra_manager/lpar.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class ManageIQ::Providers::IbmPowerHmc::InfraManager::Lpar < ManageIQ::Providers::IbmPowerHmc::InfraManager::Vm
2-
supports :publish
2+
supports :publish do
3+
unsupported_reason_add(:provisioning, _('Not connected to ems')) if ext_management_system.nil?
4+
end
35

46
def provider_object(connection = nil)
57
connection ||= ext_management_system.connect

app/models/manageiq/providers/ibm_power_hmc/infra_manager/template.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
class ManageIQ::Providers::IbmPowerHmc::InfraManager::Template < ManageIQ::Providers::InfraManager::Template
2-
supports :provisioning
3-
supports :clone
2+
supports :provisioning do
3+
if ext_management_system
4+
unsupported_reason_add(:provisioning, ext_management_system.unsupported_reason(:provisioning)) unless ext_management_system.supports?(:provisioning)
5+
else
6+
unsupported_reason_add(:provisioning, _('Not connected to ems'))
7+
end
8+
end
9+
10+
supports :clone do
11+
unsupported_reason_add(:clone, _('Not connected to ems')) if ext_management_system.nil?
12+
end
413

514
def do_request(request_type, options)
615
case request_type

0 commit comments

Comments
 (0)