[
https://issues.apache.org/jira/browse/HBASE-27030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540662#comment-17540662
]
Hudson commented on HBASE-27030:
--------------------------------
Results for branch master
[build #593 on
builds.a.o|https://ci-hbase.apache.org/job/HBase%20Nightly/job/master/593/]:
(/) *{color:green}+1 overall{color}*
----
details (if available):
(/) {color:green}+1 general checks{color}
-- For more information [see general
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/master/593/General_20Nightly_20Build_20Report/]
(/) {color:green}+1 jdk8 hadoop3 checks{color}
-- For more information [see jdk8 (hadoop3)
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/master/593/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/]
(/) {color:green}+1 jdk11 hadoop3 checks{color}
-- For more information [see jdk11
report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/master/593/JDK11_20Nightly_20Build_20Report_20_28Hadoop3_29/]
(/) {color:green}+1 source release artifact{color}
-- See build output for details.
(/) {color:green}+1 client integration test{color}
> Fix undefined local variable error in draining_servers.rb
> ---------------------------------------------------------
>
> Key: HBASE-27030
> URL: https://issues.apache.org/jira/browse/HBASE-27030
> Project: HBase
> Issue Type: Bug
> Components: jruby, shell
> Affects Versions: 3.0.0-alpha-3
> Reporter: Junegunn Choi
> Assignee: Junegunn Choi
> Priority: Major
> Fix For: 2.5.0, 3.0.0-alpha-3, 2.4.13
>
>
> 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.
> {quote}
> 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
> {quote}
>
> {code:java}
> for i in [1, 2, 3]
> a = i
> end
> puts a
> # 3
> [4, 5, 6].each do |i|
> b = i
> end
> puts b
> # undefined local variable or method `b'
> {code}
> We can define the admin local variable in the current scope beforehand, and
> we can still access it after the block.
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)