diff options
| -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 |
