Automatic merge from release/2.1.0 -> release/2.2.0

* commit 'd9b51dbca80b87966eb18a77eebe46134fe0b888':
  修正:无法删除sched_fail的主机
This commit is contained in:
邱剑
2018-10-25 11:38:41 +08:00
+1 -1
View File
@@ -145,7 +145,7 @@ func (self *SVirtualizedGuestDriver) RequestStopGuestForDelete(ctx context.Conte
if host != nil && host.Enabled && host.HostStatus == models.HOST_ONLINE {
return guest.StartGuestStopTask(ctx, task.GetUserCred(), true, task.GetTaskId())
}
if !jsonutils.QueryBoolean(task.GetParams(), "purge", false) {
if host != nil && !jsonutils.QueryBoolean(task.GetParams(), "purge", false) {
return fmt.Errorf("fail to contact host")
}
task.ScheduleRun(nil)