HDDS-963. Fix failure in TestOzoneShell due to null check in SecurityConfig.
Contributed by Ajay Kumar.
This commit is contained in:
parent
1d5734e341
commit
a5d0fcf704
@ -129,8 +129,6 @@ public SecurityConfig(Configuration configuration) {
|
||||
this.metadatDir = this.configuration.get(HDDS_METADATA_DIR_NAME,
|
||||
configuration.get(OZONE_METADATA_DIRS,
|
||||
configuration.get(HDDS_DATANODE_DIR_KEY)));
|
||||
Preconditions.checkNotNull(this.metadatDir, "Metadata directory can't be"
|
||||
+ " null. Please check configs.");
|
||||
this.keyDir = this.configuration.get(HDDS_KEY_DIR_NAME,
|
||||
HDDS_KEY_DIR_NAME_DEFAULT);
|
||||
this.privateKeyFileName = this.configuration.get(HDDS_PRIVATE_KEY_FILE_NAME,
|
||||
@ -248,6 +246,8 @@ public String getPrivateKeyFileName() {
|
||||
* @return path Key location.
|
||||
*/
|
||||
public Path getKeyLocation() {
|
||||
Preconditions.checkNotNull(this.metadatDir, "Metadata directory can't be"
|
||||
+ " null. Please check configs.");
|
||||
return Paths.get(metadatDir, keyDir);
|
||||
}
|
||||
|
||||
@ -259,6 +259,8 @@ public Path getKeyLocation() {
|
||||
* @return Path location.
|
||||
*/
|
||||
public Path getKeyLocation(String component) {
|
||||
Preconditions.checkNotNull(this.metadatDir, "Metadata directory can't be"
|
||||
+ " null. Please check configs.");
|
||||
return Paths.get(metadatDir, component, keyDir);
|
||||
}
|
||||
|
||||
@ -268,6 +270,8 @@ public Path getKeyLocation(String component) {
|
||||
* @return path Key location.
|
||||
*/
|
||||
public Path getCertificateLocation() {
|
||||
Preconditions.checkNotNull(this.metadatDir, "Metadata directory can't be"
|
||||
+ " null. Please check configs.");
|
||||
return Paths.get(metadatDir, certificateDir);
|
||||
}
|
||||
|
||||
@ -279,6 +283,8 @@ public Path getCertificateLocation() {
|
||||
* @return Path location.
|
||||
*/
|
||||
public Path getCertificateLocation(String component) {
|
||||
Preconditions.checkNotNull(this.metadatDir, "Metadata directory can't be"
|
||||
+ " null. Please check configs.");
|
||||
return Paths.get(metadatDir, component, certificateDir);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user