[PATCH conductor 1/2] BZ 799306 User quota not enforced for multi-instance deployment

Jan Provaznik jprovazn at redhat.com
Thu Mar 8 10:00:38 UTC 2012


On 03/06/2012 02:43 PM, jzigmund at redhat.com wrote:
> From: Jozef Zigmund<jzigmund at redhat.com>
>
> Added checking of user's quota in the method 'chcek_assemblies_matches(user)'
>
> https://bugzilla.redhat.com/show_bug.cgi?id=799306
> ---
>   src/app/models/deployment.rb |    5 +++--
>   1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
> index 02f2b0b..198ae5e 100644
> --- a/src/app/models/deployment.rb
> +++ b/src/app/models/deployment.rb
> @@ -382,8 +382,9 @@ class Deployment<  ActiveRecord::Base
>         end
>
>         deployment_errors = []
> -      deployment_errors<<  I18n.t('instances.errors.pool_quota_reached') if not pool.quota.can_start?(instances)
> -      deployment_errors<<  I18n.t('instances.errors.pool_family_quota_reached') if not pool.pool_family.quota.can_start?(instances)
> +      deployment_errors<<  I18n.t('instances.errors.pool_quota_reached') unless pool.quota.can_start?(instances)
> +      deployment_errors<<  I18n.t('instances.errors.pool_family_quota_reached') unless pool.pool_family.quota.can_start?(instances)
> +      deployment_errors<<  I18n.t('instances.errors.user_quota_reached') unless user.quota.can_start?(instances)
>
>         if not deployment_errors.empty?
>           raise Aeolus::Conductor::MultiError::UnlaunchableAssembly.new(I18n.t('deployments.flash.error.not_launched'), deployment_errors)

This patch updates quota checking in 'check_assemblies_matches' method 
used on 'overview' page (1 step before a user presses 'launch' button). 
But on real deployment launch quota is not checked - quota check should 
be invoked from 'launch' method too.

Jan



More information about the aeolus-devel mailing list