From 107f2ef14187f0177673565c7ede8a6deaecd998 Mon Sep 17 00:00:00 2001 From: Tina Fitzgerald Date: Fri, 8 Dec 2017 14:25:49 -0500 Subject: [PATCH] Include MiqProvisionQuotaMixin. https://bugzilla.redhat.com/show_bug.cgi?id=1517112 --- app/models/vm_cloud_reconfigure_request.rb | 1 + app/models/vm_migrate_request.rb | 1 + app/models/vm_reconfigure_request.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/models/vm_cloud_reconfigure_request.rb b/app/models/vm_cloud_reconfigure_request.rb index 06ebcecd221..18e09a8f506 100644 --- a/app/models/vm_cloud_reconfigure_request.rb +++ b/app/models/vm_cloud_reconfigure_request.rb @@ -6,6 +6,7 @@ class VmCloudReconfigureRequest < MiqRequest validates :request_state, :inclusion => { :in => %w(pending finished) + ACTIVE_STATES, :message => "should be pending, #{ACTIVE_STATES.join(", ")} or finished"} validate :must_have_user + include MiqProvisionQuotaMixin def vms Vm.find(options[:src_ids]) diff --git a/app/models/vm_migrate_request.rb b/app/models/vm_migrate_request.rb index 6b0e5aa8a5e..de019077aad 100644 --- a/app/models/vm_migrate_request.rb +++ b/app/models/vm_migrate_request.rb @@ -5,6 +5,7 @@ class VmMigrateRequest < MiqRequest validates_inclusion_of :request_state, :in => %w( pending finished ) + ACTIVE_STATES, :message => "should be pending, #{ACTIVE_STATES.join(", ")} or finished" validate :must_have_user + include MiqProvisionQuotaMixin def my_zone vm = Vm.find_by(:id => options[:src_ids]) diff --git a/app/models/vm_reconfigure_request.rb b/app/models/vm_reconfigure_request.rb index 94d7e4d4a6d..b55fa4cc738 100644 --- a/app/models/vm_reconfigure_request.rb +++ b/app/models/vm_reconfigure_request.rb @@ -5,6 +5,7 @@ class VmReconfigureRequest < MiqRequest validates_inclusion_of :request_state, :in => %w( pending finished ) + ACTIVE_STATES, :message => "should be pending, #{ACTIVE_STATES.join(", ")} or finished" validate :must_have_user + include MiqProvisionQuotaMixin def self.request_limits(options) # Memory values are in megabytes