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

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Janos Gub 2018-01-12 10:16:13 +01:00 committed by tedyu
parent 20ccaef841
commit 8bbfcdda46
1 changed files with 2 additions and 1 deletions

View File

@ -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}!"