Not a big fan of having 2 lines of the exact same code.  How about:
```ruby
begin
  Chef::Log.info 'Waiting for slave to become functional...'
  sleep 2 if defined?(slave_status)
  slave_status = query(hostname, password, 'SHOW SLAVE STATUS')
end until slave_status["Slave_IO_Running"] == "Yes" && slave_status["Slave_SQL_Running"] == "Yes"
```
or even a `loop do ... break`