Fix Agent showpass 37/71637/1
authorInstrumental <jonathan.gathman@att.com>
Thu, 1 Nov 2018 14:27:57 +0000 (09:27 -0500)
committerInstrumental <jonathan.gathman@att.com>
Thu, 1 Nov 2018 14:28:03 +0000 (09:28 -0500)
Issue-ID: AAF-601
Change-Id: Ifc1b71edad9516ef8712d93898bc78164f8efcca
Signed-off-by: Instrumental <jonathan.gathman@att.com>
cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java

index 3facc93..4a5fbd4 100644 (file)
@@ -680,9 +680,12 @@ public class Agent {
                             FileInputStream fis = new FileInputStream(new File(dir,a.getNs()+".cred.props"));
                             try {
                                 props.load(fis);
-                                fis.close();
-                                fis = new FileInputStream(new File(dir,a.getNs()+".chal"));
-                                props.load(fis);
+                                File chalFile = new File(dir,a.getNs()+".chal");
+                                if(chalFile.exists()) {
+                                    fis.close();
+                                       fis = new FileInputStream(chalFile);
+                                       props.load(fis);
+                                }
                             } finally {
                                 fis.close();
                             }