[email protected] wrote:
> This Series of patches adds the ability to Create/Edit/Delete quota on Pools 
> and Cloud Accounts.  It Audits quota by storing totals on the quota model.  
> Then enforces the Quota on Instance Create/Start in TaskOMatic
> _______________________________________________
> deltacloud-devel mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/deltacloud-devel
>   
I started testing this and ran into a couple issues.

First -- I  think you must have forgotten to check in the Quota factory 
class -- when I run 'rake spec' I ran into several of the same error 
message 'no such factory Quota' or something like that.

When I tried to create an instance after defining quotas, I hit an error 
in the InstanceObserver class:

TypeError (ActiveRecord::Associations::BelongsToAssociation can't be 
coerced into Fixnum):
  app/models/instance_observer.rb:55:in `update_quota'
  app/models/instance_observer.rb:41:in `each'
  app/models/instance_observer.rb:41:in `update_quota'
  app/models/instance_observer.rb:11:in `before_save'
  /usr/lib/ruby/1.8/observer.rb:185:in `notify_observers'
  /usr/lib/ruby/1.8/observer.rb:184:in `each'
  /usr/lib/ruby/1.8/observer.rb:184:in `notify_observers'

Looking up this line:
  quota.total_storage += hwp.storage

I think this is an incompatibility with my latest HWP patch.

I changed the line to:
  quota.total_storage += hwp.storage.value.to_f
(along with the other 3 other lines in the observer which reference hwp 
values)

I ran into a similar problem in quota.rb as well -- adding '.value.to_f' 
to the hwp retrieval lines.

Once I made those changes I could create instances. For the most part 
everything was working fine, although I did hit one other issue that I 
haven't fully tracked down:

When I set a back-end account quota of 2 instances, I got up to 2 
running instances as expected, and the third instance I tried to start 
failed with the expected failure reason. I then updated the quota to 4 
on the back end account, and 3 running instances on the pool. Now the 
third instance started fine, but when I tried to start a 4th instance, I 
got no errors on submission, but the instance was never inserted in the 
database. So rather than either a form validation error, or a task 
failure message, the instance was simply not created and/or not saved in 
the database.

Scott

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to