The `slave_status` variable is not in the scope of the block inside the loop. So we are actually doing:
```ruby
slave_status = nil
begin
  Chef::Log.info 'Waiting for slave to become functional...'
  sleep 2 if slave_status
  slave_status = query(hostname, password, 'SHOW SLAVE STATUS')
end until slave_status["Slave_IO_Running"] == "Yes" && slave_status["Slave_SQL_Running"] == "Yes"
```