diff options
| author | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-21 23:10:45 -0400 |
|---|---|---|
| committer | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-21 23:10:45 -0400 |
| commit | 583ada5bdbaf57de345ecbc7c3ea7f59dfa0794d (patch) | |
| tree | 15892326ce3ab0911e5c0dcbd15772ad814e8aa7 /cloudmasterd | |
| parent | 8a0b57d23f49710fdffa037ec007e10e2968bcf0 (diff) | |
| download | tools-583ada5bdbaf57de345ecbc7c3ea7f59dfa0794d.tar.gz tools-583ada5bdbaf57de345ecbc7c3ea7f59dfa0794d.tar.xz tools-583ada5bdbaf57de345ecbc7c3ea7f59dfa0794d.zip | |
Optimizing DB updates
Diffstat (limited to 'cloudmasterd')
| -rw-r--r-- | cloudmasterd/lib/cloudmasterd.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cloudmasterd/lib/cloudmasterd.rb b/cloudmasterd/lib/cloudmasterd.rb index ce4513b..7ea6038 100644 --- a/cloudmasterd/lib/cloudmasterd.rb +++ b/cloudmasterd/lib/cloudmasterd.rb @@ -266,8 +266,7 @@ def sync_state Cloudmasterd::Models::Machine.find(:all).each do |machine| if current_state.has_key?(machine.name) then # We have a current state match for this machine - machine.update_attribute(:state, current_state[machine.name][:state]) - machine.update_attribute(:cloud, current_state[machine.name][:cloud]) + machine.update_attributes(:cloud => current_state[machine.name][:cloud], :state => current_state[machine.name][:state]) # Delete the key so we can determine unaccounted for machines current_state.delete(machine.name) |
