From eeaff02a5ccff4d8bc1b0429a72752933f617385 Mon Sep 17 00:00:00 2001 From: Janos Gub Date: Fri, 12 Jan 2018 10:16:13 +0100 Subject: [PATCH] HBASE-19771 restore_snapshot shell command gives wrong namespace if the namespace doesn't exist --- hbase-shell/src/main/ruby/shell/commands.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git hbase-shell/src/main/ruby/shell/commands.rb hbase-shell/src/main/ruby/shell/commands.rb index f17a7f6348..1b8de9e7f2 100644 --- hbase-shell/src/main/ruby/shell/commands.rb +++ 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: (?[^\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}!" -- 2.13.6 (Apple Git-96)