junegunn opened a new pull request, #4427:
URL: https://github.com/apache/hbase/pull/4427
HBASE-21812 replaced a for-loop with an each block. Each block introduces a
new scope, so a local variable defined inside it cannot be accessed afterwards.
```
NameError: undefined local variable or method `admin' for main:Object
getServerNames at /opt/khp/hbase/bin/draining_servers.rb:81
addServers at /opt/khp/hbase/bin/draining_servers.rb:88
<main> at /opt/khp/hbase/bin/draining_servers.rb:146
```
This commit defines the admin local variable in the current scope
beforehand, so that we can still access it after the block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]