HDFS-10417. Improve error message from checkBlockLocalPathAccess. Contributed by Tianyin Xu.
This commit is contained in:
parent
feb90ffcca
commit
204de430bf
@ -1717,7 +1717,8 @@ private void checkBlockLocalPathAccess() throws IOException {
|
||||
throw new AccessControlException(
|
||||
"Can't continue with getBlockLocalPathInfo() "
|
||||
+ "authorization. The user " + currentUser
|
||||
+ " is not allowed to call getBlockLocalPathInfo");
|
||||
+ " is not configured in "
|
||||
+ DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,10 +375,12 @@ public void testDeprecatedGetBlockLocalPathInfoRpc() throws IOException {
|
||||
try {
|
||||
proxy.getBlockLocalPathInfo(blk, token);
|
||||
Assert.fail("The call should have failed as this user "
|
||||
+ " is not allowed to call getBlockLocalPathInfo");
|
||||
+ " is not configured in "
|
||||
+ DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY);
|
||||
} catch (IOException ex) {
|
||||
Assert.assertTrue(ex.getMessage().contains(
|
||||
"not allowed to call getBlockLocalPathInfo"));
|
||||
"not configured in "
|
||||
+ DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY));
|
||||
}
|
||||
} finally {
|
||||
fs.close();
|
||||
|
Loading…
Reference in New Issue
Block a user