This is an automated email from the ASF dual-hosted git repository.

aengineer pushed a commit to branch HDDS-4
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/HDDS-4 by this push:
     new 54ef9c6  HDDS-963. Fix failure in TestOzoneShell due to null check in 
SecurityConfig. Contributed by Ajay Kumar.
54ef9c6 is described below

commit 54ef9c6b22e51b72f7e53e9a648fe3195382ccbf
Author: Anu Engineer <[email protected]>
AuthorDate: Fri Jan 4 13:13:10 2019 -0800

    HDDS-963. Fix failure in TestOzoneShell due to null check in SecurityConfig.
    Contributed by Ajay Kumar.
---
 .../org/apache/hadoop/hdds/security/x509/SecurityConfig.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java
 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java
index e564c96..bf1cc4d 100644
--- 
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java
+++ 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/SecurityConfig.java
@@ -129,8 +129,6 @@ public class SecurityConfig {
     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 class SecurityConfig {
    * @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 class SecurityConfig {
    * @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 class SecurityConfig {
    * @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 class SecurityConfig {
    * @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);
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to