Author: swagle
Date: Tue Mar 26 20:38:43 2013
New Revision: 1461301

URL: http://svn.apache.org/r1461301
Log:
AMBARI-1713. Need to delete private ssh key from 
/var/run/ambari-server/bootstrap/* on Ambari Server after bootstrap is 
complete. (swagle)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
    
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapTest.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1461301&r1=1461300&r2=1461301&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Mar 26 20:38:43 2013
@@ -527,6 +527,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1713. Need to delete private ssh key from /var/run/ambari-server
+ /bootstrap/* on Ambari Server after bootstrap is complete. (swagle)
+
  AMBARI-1711. Trunk is broken due  to invalid argument to a puppet custom 
  function hdp_default. (swagle)
 

Modified: 
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java?rev=1461301&r1=1461300&r2=1461301&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
 (original)
+++ 
incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
 Tue Mar 26 20:38:43 2013
@@ -271,6 +271,12 @@ class BSRunner extends Thread {
       tmpStatus.setStatus(stat);
       bsImpl.updateStatus(requestId, tmpStatus);
       bsImpl.reset();
+      // Remove private ssh key after bootstrap is complete
+      try {
+        FileUtils.forceDelete(sshKeyFile);
+      } catch (IOException io) {
+        LOG.info(io.getMessage());
+      }
       finished();
     }
   }

Modified: 
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapTest.java
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapTest.java?rev=1461301&r1=1461300&r2=1461301&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapTest.java
 (original)
+++ 
incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/bootstrap/BootStrapTest.java
 Tue Mar 26 20:38:43 2013
@@ -89,6 +89,7 @@ public class BootStrapTest extends TestC
     /* Note its an echo command so it should echo host1,host2 */
     Assert.assertTrue(status.getLog().contains("host1,host2"));
     Assert.assertEquals(BSStat.SUCCESS, status.getStatus());
+    Assert.assertFalse(new File(bootdir + File.separator + "1" + 
File.separator + "sshKey").exists());
   }
 
 


Reply via email to