Repository: hbase
Updated Branches:
  refs/heads/branch-2 72702eeb7 -> f7fbc168a


HBASE-19771 restore_snapshot shell command gives wrong namespace if the 
namespace doesn't exist

Signed-off-by: tedyu <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f7fbc168
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f7fbc168
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f7fbc168

Branch: refs/heads/branch-2
Commit: f7fbc168a1538ab4157db8aeeeee8fa9f7827774
Parents: 72702ee
Author: Janos Gub <[email protected]>
Authored: Fri Jan 12 10:16:13 2018 +0100
Committer: tedyu <[email protected]>
Committed: Fri Jan 12 07:37:40 2018 -0800

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/shell/commands.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f7fbc168/hbase-shell/src/main/ruby/shell/commands.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/commands.rb 
b/hbase-shell/src/main/ruby/shell/commands.rb
index f17a7f6..1b8de9e 100644
--- a/hbase-shell/src/main/ruby/shell/commands.rb
+++ b/hbase-shell/src/main/ruby/shell/commands.rb
@@ -117,7 +117,8 @@ module Shell
           raise "Unknown region #{args.first}!"
         end
         if cause.is_a?(org.apache.hadoop.hbase.NamespaceNotFoundException)
-          raise "Unknown namespace #{args.first.split(':')[0]}!"
+          s = /.*NamespaceNotFoundException: 
(?<namespace>[^\n]+).*/.match(cause.message)
+          raise "Unknown namespace #{s['namespace']}!"
         end
         if 
cause.is_a?(org.apache.hadoop.hbase.snapshot.SnapshotDoesNotExistException)
           raise "Unknown snapshot #{args.first}!"

Reply via email to