Loiseleur Michel
2009-Oct-06 12:43 UTC
[Ovirt-devel] [PATCH] Fix refreshing vms list This patch fix vms index view when a smart pool is not destroyed correctly.
Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> --- app/models/smart_pool.rb | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/models/smart_pool.rb b/app/models/smart_pool.rb index 1f718a8..9afc354 100644 --- a/app/models/smart_pool.rb +++ b/app/models/smart_pool.rb @@ -62,18 +62,16 @@ class SmartPool < Pool if nested_pools nested_pools.each do |pool_element| pool = pool_element[:obj] - if pool.hasChildren + if pool.hasChildren and pool_element.has_key?(:children) if pool.name == user pool_element[:children].each do |child_element| child_pool = child_element[:obj] user_pools <<[child_pool.name, child_pool.id] end else - if pool_element.has_key?(:children) - pool_element[:children].each do |child_element| - child_pool = child_element[:obj] - other_pools << [pool.name + " > " + child_pool.name, child_pool.id] - end + pool_element[:children].each do |child_element| + child_pool = child_element[:obj] + other_pools << [pool.name + " > " + child_pool.name, child_pool.id] end end end -- 1.6.2.5
Mohammed Morsi
2009-Oct-14 19:03 UTC
[Ovirt-devel] [PATCH] Fix refreshing vms list This patch fix vms index view when a smart pool is not destroyed correctly.
Loiseleur Michel wrote:> Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> > --- > app/models/smart_pool.rb | 10 ++++------ > 1 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/app/models/smart_pool.rb b/app/models/smart_pool.rb > index 1f718a8..9afc354 100644 > --- a/app/models/smart_pool.rb > +++ b/app/models/smart_pool.rb > @@ -62,18 +62,16 @@ class SmartPool < Pool > if nested_pools > nested_pools.each do |pool_element| > pool = pool_element[:obj] > - if pool.hasChildren > + if pool.hasChildren and pool_element.has_key?(:children) > if pool.name == user > pool_element[:children].each do |child_element| > child_pool = child_element[:obj] > user_pools <<[child_pool.name, child_pool.id] > end > else > - if pool_element.has_key?(:children) > - pool_element[:children].each do |child_element| > - child_pool = child_element[:obj] > - other_pools << [pool.name + " > " + child_pool.name, child_pool.id] > - end > + pool_element[:children].each do |child_element| > + child_pool = child_element[:obj] > + other_pools << [pool.name + " > " + child_pool.name, child_pool.id] > end > end > end >I tried this out and it works, and the code looks good, but couldn't figure out the use case which this is supposed to fix inorder to test it out. Regardless every seems to work with it included so ACK and pushed (though the path to the 'smart_pool.rb' file in the patch seems to be messed up as its missing the leading 'src/', which I tweaked before commiting) One other thing, you can split your git commit message into multiple lines if you want, the first being a very short summary of the patch to appear in the shortlog http://git.et.redhat.com/?p=ovirt-server.git;a=shortlog;h=refs/heads/next and the rest will appear before the patch itself. Up to you; regardless thanks for the contribution and sorry for the delay in ack'ing it. -Mo
Apparently Analagous Threads
- acts_as_tree and before_save
- [PATCH server] Bug 478729 - Cannot add vm to smart pool after select one vm
- [PATCH server] Updated look and feel for empty grid views
- [PATCH server] remove vm forward vnc and vm host history
- permit many-to-many vms / networks relationship redux