fix: 忽略裸金属器删除条件

This commit is contained in:
ioito
2019-09-02 16:30:09 +08:00
parent 11e009a074
commit 9efaaf0620
+1 -1
View File
@@ -528,7 +528,7 @@ func (guest *SGuest) ValidatePurgeCondition(ctx context.Context) error {
func (guest *SGuest) ValidateDeleteCondition(ctx context.Context) error {
host := guest.GetHost()
if host != nil {
if host != nil && guest.GetHypervisor() != api.HYPERVISOR_BAREMETAL {
if !host.Enabled {
return httperrors.NewInputParameterError("Cannot delete server on disabled host")
}