Metaswitch/chef — pull request #77 by bossmc (2013-11-14 17:29:36+00:00)
Title: `undefined local variable or method `expected'` finishing a re-size operation

Representative backtrace:

```
knife deployment resize -E clearwater --finish -VV

INFO: Creating deployment in environment: clearwater
DEBUG: Signing the request as chef-client
DEBUG: Sending HTTP Request via GET to chef-server.my-domain.me:4000/environments/clearwater
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: content-type: application/json; charset=utf-8
DEBUG: connection: close
DEBUG: server: thin 1.3.1 codename Triple Espresso
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Signing the request as chef-client
DEBUG: Sending HTTP Request via GET to chef-server.my-domain.me:4000/search/node
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: content-type: application/json; charset=utf-8
DEBUG: connection: close
DEBUG: server: thin 1.3.1 codename Triple Espresso
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Signing the request as chef-client
DEBUG: Sending HTTP Request via GET to chef-server.my-domain.me:4000/nodes/clearwater-sprout-4
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: content-type: application/json; charset=utf-8
DEBUG: connection: close
DEBUG: server: thin 1.3.1 codename Triple Espresso
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Signing the request as chef-client
DEBUG: Sending HTTP Request via GET to chef-server.my-domain.me:4000/roles/clearwater-infrastructure
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: content-type: application/json; charset=utf-8
DEBUG: connection: close
DEBUG: server: thin 1.3.1 codename Triple Espresso
DEBUG: ---- End HTTP Status/Header Data ----
/home/ubuntu/chef/.chef/plugins/knife/boxes.rb:302:in `box_ready_to_delete?': undefined local variable or method `expected' for # (NameError)
from /home/ubuntu/chef/.chef/plugins/knife/boxes.rb:348:in `block in find_incomplete_quiescing_nodes'
from /home/ubuntu/chef/.chef/plugins/knife/boxes.rb:347:in `select'
from /home/ubuntu/chef/.chef/plugins/knife/boxes.rb:347:in `find_incomplete_quiescing_nodes'
from /home/ubuntu/chef/.chef/plugins/knife/knife-deployment-resize.rb:324:in `run'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/chef-11.4.0/lib/chef/knife.rb:460:in `run_with_pretty_exceptions'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/chef-11.4.0/lib/chef/knife.rb:173:in `run'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/chef-11.4.0/lib/chef/application/knife.rb:123:in `run'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/chef-11.4.0/bin/knife:25:in `'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin/knife:19:in `load'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin/knife:19:in `

'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `eval'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `

'
```

This looks to be caused by `expected` being defined inside the `Net::SSH.start` block but being referenced outside (unlike the `ssh_return` parameter).