diff options
| author | Matt Hicks <mhicks@localhost.localdomain> | 2008-07-16 17:57:43 -0400 |
|---|---|---|
| committer | Matt Hicks <mhicks@localhost.localdomain> | 2008-07-16 17:57:43 -0400 |
| commit | c8bfaf2e061d3ee5facbc21f173915b0090e181c (patch) | |
| tree | 5de2d5c9c06c23423d7353cb08c19e97a1e07d51 /cloudmasterd | |
| parent | 20b268c1a5d13665d85b14d0d5ec47e9388787b3 (diff) | |
| download | tools-c8bfaf2e061d3ee5facbc21f173915b0090e181c.tar.gz tools-c8bfaf2e061d3ee5facbc21f173915b0090e181c.tar.xz tools-c8bfaf2e061d3ee5facbc21f173915b0090e181c.zip | |
Handling multiple machines coming back from the state
Diffstat (limited to 'cloudmasterd')
| -rw-r--r-- | cloudmasterd/lib/cloudmasterd/syncer.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudmasterd/lib/cloudmasterd/syncer.rb b/cloudmasterd/lib/cloudmasterd/syncer.rb index bb191a6..4bda1a5 100644 --- a/cloudmasterd/lib/cloudmasterd/syncer.rb +++ b/cloudmasterd/lib/cloudmasterd/syncer.rb @@ -89,9 +89,11 @@ class Syncer def sync_state current_state = {} Open3.popen3("func '*' call virt state") do |stdin, stdout, stderr| - YAML.load(stdout.read).each do |host, value| - name, state = value[0].split(" ") - current_state[name] = {:state => state, :cloud => host} unless name == "Domain-0" + YAML.load(stdout.read).each do |host, machines| + machines.each do |machine| + name, state = machine.split(" ") + current_state[name] = {:state => state, :cloud => host} unless name == "Domain-0" + end end end |
