HDDS-957. Replace incorrect use of system property user.name.
Contributed by Dinesh Chitlangia.
This commit is contained in:
parent
cfe89e6f96
commit
14d232c0fe
@ -79,7 +79,7 @@ public Void call() throws Exception {
|
|||||||
if (root) {
|
if (root) {
|
||||||
rootName = "hdfs";
|
rootName = "hdfs";
|
||||||
} else {
|
} else {
|
||||||
rootName = System.getProperty("user.name");
|
rootName = UserGroupInformation.getCurrentUser().getShortUserName();
|
||||||
}
|
}
|
||||||
|
|
||||||
VolumeArgs.Builder volumeArgsBuilder = VolumeArgs.newBuilder()
|
VolumeArgs.Builder volumeArgsBuilder = VolumeArgs.newBuilder()
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
import org.apache.hadoop.ozone.web.ozShell.Shell;
|
import org.apache.hadoop.ozone.web.ozShell.Shell;
|
||||||
import org.apache.hadoop.ozone.web.utils.JsonUtils;
|
import org.apache.hadoop.ozone.web.utils.JsonUtils;
|
||||||
|
|
||||||
|
import org.apache.hadoop.security.UserGroupInformation;
|
||||||
import picocli.CommandLine.Command;
|
import picocli.CommandLine.Command;
|
||||||
import picocli.CommandLine.Option;
|
import picocli.CommandLine.Option;
|
||||||
import picocli.CommandLine.Parameters;
|
import picocli.CommandLine.Parameters;
|
||||||
@ -76,7 +77,7 @@ public Void call() throws Exception {
|
|||||||
OzoneClient client = address.createClient(createOzoneConfiguration());
|
OzoneClient client = address.createClient(createOzoneConfiguration());
|
||||||
|
|
||||||
if (userName == null) {
|
if (userName == null) {
|
||||||
userName = System.getProperty("user.name");
|
userName = UserGroupInformation.getCurrentUser().getShortUserName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxVolumes < 1) {
|
if (maxVolumes < 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user