From 945dcae9c05d5522fe2fd2cf22f7f5698e9bddb1 Mon Sep 17 00:00:00 2001 From: emcho Date: Sun, 2 Mar 2014 02:37:44 +0000 Subject: [PATCH] Calling ec2metadata seems to be causing issues on some machines. Changes detection to just work by detecting if it's there. --- src/org/ice4j/ice/harvest/AwsCandidateHarvester.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/ice4j/ice/harvest/AwsCandidateHarvester.java b/src/org/ice4j/ice/harvest/AwsCandidateHarvester.java index 348810d..892be22 100644 --- a/src/org/ice4j/ice/harvest/AwsCandidateHarvester.java +++ b/src/org/ice4j/ice/harvest/AwsCandidateHarvester.java @@ -179,7 +179,11 @@ public class AwsCandidateHarvester { try { - Runtime.getRuntime().exec("ec2metadata"); + if(new File("/usr/bin/ec2metadata").exists()) + return true; + + //the command below seems to be freezing on some systems. + //Runtime.getRuntime().exec("ec2metadata --help"); //if this is an AWS EC2 we would throw an exception above and not //get here, so ... be happy