HDFS-10417. Improve error message from checkBlockLocalPathAccess. Contributed by Tianyin Xu.
(cherry picked from commit 204de430bf
)
This commit is contained in:
parent
2d846fdcbd
commit
bae151801d
|
@ -1703,7 +1703,8 @@ public class DataNode extends ReconfigurableBase
|
||||||
throw new AccessControlException(
|
throw new AccessControlException(
|
||||||
"Can't continue with getBlockLocalPathInfo() "
|
"Can't continue with getBlockLocalPathInfo() "
|
||||||
+ "authorization. The user " + currentUser
|
+ "authorization. The user " + currentUser
|
||||||
+ " is not allowed to call getBlockLocalPathInfo");
|
+ " is not configured in "
|
||||||
|
+ DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -376,10 +376,12 @@ public class TestShortCircuitLocalRead {
|
||||||
try {
|
try {
|
||||||
proxy.getBlockLocalPathInfo(blk, token);
|
proxy.getBlockLocalPathInfo(blk, token);
|
||||||
Assert.fail("The call should have failed as this user "
|
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) {
|
} catch (IOException ex) {
|
||||||
Assert.assertTrue(ex.getMessage().contains(
|
Assert.assertTrue(ex.getMessage().contains(
|
||||||
"not allowed to call getBlockLocalPathInfo"));
|
"not configured in "
|
||||||
|
+ DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
fs.close();
|
fs.close();
|
||||||
|
|
Loading…
Reference in New Issue